This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

if command

Help with usage of shell accounts and bouncers.
Post Reply
C
Corne
Voice
Posts: 6
Joined: Thu Feb 08, 2007 9:25 pm

if command

Post by Corne »

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 ?
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: if command

Post by user »

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"?
C
Corne
Voice
Posts: 6
Joined: Thu Feb 08, 2007 9:25 pm

Post by Corne »

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...
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Corne wrote:It's english...
Nope! It's Tcl. :)

'if' conditional statements are used in more than just Tcl.

Code: Select all

if {[isop $nick $chan]} { ... }
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
C
Corne
Voice
Posts: 6
Joined: Thu Feb 08, 2007 9:25 pm

Post by Corne »

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).
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

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"?
C
Corne
Voice
Posts: 6
Joined: Thu Feb 08, 2007 9:25 pm

Post by Corne »

I just red that help file but it doesnt say anything about choosing a programing language. I understood how psybnc scripting works though
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

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"?
C
Corne
Voice
Posts: 6
Joined: Thu Feb 08, 2007 9:25 pm

Post by Corne »

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: Select all

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
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Corne wrote:

Code: Select all

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"?
C
Corne
Voice
Posts: 6
Joined: Thu Feb 08, 2007 9:25 pm

Post by Corne »

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)
Post Reply