Page 1 of 1

Script Security

PostPosted: Thu Jan 28, 2010 7:08 pm
by edgy
Hi,

Say I have a script on my bot (e.g. !staffonly) and I want it only to work for people who are ops how would I secure my command?

I have tried code snippets off other website but I can't get them to work. All I want the command to do is output some text?

Many thanks,
edgy :geek:

Re: Script Security

PostPosted: Thu Jan 28, 2010 7:21 pm
by Phil
/help access levels

Re: Script Security

PostPosted: Thu Jan 28, 2010 7:23 pm
by edgy
No such command.

:?

Re: Script Security

PostPosted: Thu Jan 28, 2010 7:24 pm
by edgy
Wait, it loaded!

Typed it in the wrong window! :lol:

Re: Script Security

PostPosted: Thu Jan 28, 2010 7:26 pm
by edgy
Wait, is there any way to use the channels level and not a internal access list on the client?

(e.g. using the isop, but I don't know how to use it :? )

Re: Script Security

PostPosted: Thu Jan 28, 2010 7:34 pm
by Phil
/help if then else

Re: Script Security

PostPosted: Thu Jan 28, 2010 7:47 pm
by edgy
I followed the instructions but it won't work :(

on 1:text:!chantopic 1:#jojay:if($nick isop $chan){/topic $chan $2- - http://jojaynetwork.co.cc/} else{/msg $chan Access denied}

Re: Script Security

PostPosted: Thu Jan 28, 2010 7:52 pm
by Phil
If you correctly formatted your code it would be easier to find your syntax errors.

Try:

Code: Select all
on 1:text:!chantopic 1:#jojay:{
  if($nick isop $chan) {
    /topic $chan $2- - http://jojaynetwork.co.cc/
  }
  else {
    /msg $chan Access denied
  }
}


Phil

Re: Script Security

PostPosted: Thu Jan 28, 2010 7:54 pm
by edgy
Thanks but it still is letting unopped people change it :/

Please take a look in #jojay

Re: Script Security

PostPosted: Thu Jan 28, 2010 8:15 pm
by edgy
Yey, it works now! Thanks Phil! :D
Code: Select all
on 1:text:!chantopic *:#jojay:{
  if ($nick isop $chan) {
    /topic $chan $2- - http://jojaynetwork.co.cc/
  }
  else {
    /notice $nick Access denied.
  }
}