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 

help needed

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
lenooxx
Voice


Joined: 24 Mar 2009
Posts: 27
Location: Hungarian

PostPosted: Sat Nov 21, 2009 10:40 am    Post subject: help needed Reply with quote

heya , i need help , i have tried creating a script , but it dosent work for me , someone know whats wrong? Thank you

Code:

set urls {
"http://whaterver.com"
}

set posting_chans "*"

bind time  10  posting

proc posting {nick uhost hand chan arg} {
   global urls posting_chans
   foreach chan [channels] {if {(([lsearch -exact [string tolower $posting_chans] [string tolower $chan]] != -1) || ($posting_chans == "*"))} {putserv "PRIVMSG $chan :[lindex $urls [rand [llength $urls]]]"}}
}
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Nov 21, 2009 11:26 am    Post subject: Reply with quote

I'm in a hurry, so I'm just going to comment on the binding (without checking the code inside the procedure). If you want it to execute every 10 minutes, then this is the proper binding:
Code:
bind time - {?0 *} posting

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
lenooxx
Voice


Joined: 24 Mar 2009
Posts: 27
Location: Hungarian

PostPosted: Sat Nov 21, 2009 12:06 pm    Post subject: :) Reply with quote

thank you very much ^^
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Nov 21, 2009 9:45 pm    Post subject: Reply with quote

Also, you're using [lsearch] to search in a string (which is never recommended), $posting_chans should be a list. Wildcards in [lsearch] can only be used with -glob switch and the wildcards are specified in the third argument (the search string).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting 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