I looked up to lots of forums to find the syntax of the 'if' conditiona. I wanna check if a nickname is op on a channel. would it be something like if (nick isop #channel) do whatever ?
what do you mean ? I just need the syntax for a bouncer/psybnc. I'm trying to make a script and I need to add a check if a specified nickname is op on a specified channel.... like in mirc scripting if ($nick isop #channel). It's english...
I need it for my bouncer/psybnc. Now I understood your question about 'language', programing language'. I dont know if its the same with tcl (even though I doubt it).
There is no built in script engine in psybnc - it will execute shell commands/scripts/executables for you - which makes it less efficient (in average execution time), but more flexible.
Read http://www.psybnc.at/scripting.html to understand how psybnc scripting works, then pick a language and create a script that works how you want it to when executed by the bouncer.
Corne wrote:I understood how psybnc scripting works though
No.
http://www.psybnc.at/scripting.html wrote:A script can be anything, which can be handled by the shell. You also can
call PHP/Perl/tcl-Scripts from the script-Entry.
I just look over the text but didnt really read everything (i was at school). I remember seeing a php script used for psybnc (trying to avoid an server error or something. So I just add the tcl script in the USERnumber.SCRIPT file and sreload ? anyways ... I dont know tcl scripting but I looked at some scripts here. Didnt get much though. I need to do that op check on an notice event (server notice) and dont know how to start. I looked up to some scripts here and found something. Tried to simplify it and I got this:
bind notc - "*Highest connection count*" msglogin
proc msglogin {
if {[isop me #channel]} { putserv "PRIVMSG X :deop #channel" }
}
and when I do a sreload I get this
[15:44:23] <-psyBNC> Fri Feb 9 22:47:48 :Bogus scripting Line in scripts/USER1.SCRIPT Line 1, 2 and 3
1) 'bind', 'isop' and 'putserv' are not native tcl commands.
2) 'proc' expects 3 arguments
3) you don't seem to be executing the script via tclsh (psybnc doesn't know tcl)
Take a look at http://tcl.tk/man/tcl8.4/TclCmd/contents.htm for commands that will be avaliable in your script executed in tclsh (which is what you'll need to do if you want it to work with psybnc)
But how do I execute it in tclsh ? can you give me an example ? (now I'm looking on that website and searching for the commands useful for this script)