egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

if command

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Shell & Bouncer Help
View previous topic :: View next topic  
Author Message
Corne
Voice


Joined: 08 Feb 2007
Posts: 6

PostPosted: Thu Feb 08, 2007 9:27 pm    Post subject: if command Reply with quote

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
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Thu Feb 08, 2007 10:43 pm    Post subject: Re: if command Reply with quote

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
View user's profile Send private message
Corne
Voice


Joined: 08 Feb 2007
Posts: 6

PostPosted: Thu Feb 08, 2007 11:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Fri Feb 09, 2007 5:16 am    Post subject: Reply with quote

http://www.tcl.tk/man/tcl8.4/TclCmd/if.htm
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Feb 09, 2007 6:23 am    Post subject: Reply with quote

Corne wrote:
It's english...

Nope! It's Tcl. Smile

'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
View user's profile Send private message Visit poster's website
Corne
Voice


Joined: 08 Feb 2007
Posts: 6

PostPosted: Fri Feb 09, 2007 8:40 am    Post subject: Reply with quote

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
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Fri Feb 09, 2007 8:52 am    Post subject: Reply with quote

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
View user's profile Send private message
Corne
Voice


Joined: 08 Feb 2007
Posts: 6

PostPosted: Fri Feb 09, 2007 10:13 am    Post subject: Reply with quote

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
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Fri Feb 09, 2007 10:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Corne
Voice


Joined: 08 Feb 2007
Posts: 6

PostPosted: Fri Feb 09, 2007 4:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Fri Feb 09, 2007 5:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Corne
Voice


Joined: 08 Feb 2007
Posts: 6

PostPosted: Fri Feb 09, 2007 5:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Shell & Bouncer Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber