| View previous topic :: View next topic |
| Author |
Message |
Corne Voice
Joined: 08 Feb 2007 Posts: 6
|
Posted: Thu Feb 08, 2007 9:27 pm Post subject: if command |
|
|
| 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 ? |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Thu Feb 08, 2007 10:43 pm Post subject: Re: if command |
|
|
| Corne wrote: | | I looked up to lots of forums to find the syntax of the 'if' conditiona. |
in what language? _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
Corne Voice
Joined: 08 Feb 2007 Posts: 6
|
Posted: Thu Feb 08, 2007 11:21 pm Post subject: |
|
|
| 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... |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Feb 09, 2007 6:23 am Post subject: |
|
|
| Corne wrote: | | It's english... |
Nope! It's Tcl.
'if' conditional statements are used in more than just Tcl.
| Code: | | if {[isop $nick $chan]} { ... } |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Corne Voice
Joined: 08 Feb 2007 Posts: 6
|
Posted: Fri Feb 09, 2007 8:40 am Post subject: |
|
|
| 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). |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Fri Feb 09, 2007 8:52 am Post subject: |
|
|
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. _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
Corne Voice
Joined: 08 Feb 2007 Posts: 6
|
Posted: Fri Feb 09, 2007 10:13 am Post subject: |
|
|
| I just red that help file but it doesnt say anything about choosing a programing language. I understood how psybnc scripting works though |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Fri Feb 09, 2007 10:58 am Post subject: |
|
|
| 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. |
_________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
Corne Voice
Joined: 08 Feb 2007 Posts: 6
|
Posted: Fri Feb 09, 2007 4:51 pm Post subject: |
|
|
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:
| Code: |
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 |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Fri Feb 09, 2007 5:26 pm Post subject: |
|
|
| Corne wrote: | | Code: |
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) _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
Corne Voice
Joined: 08 Feb 2007 Posts: 6
|
Posted: Fri Feb 09, 2007 5:49 pm Post subject: |
|
|
| 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) |
|
| Back to top |
|
 |
|