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 

need tcl script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
swasteris
Voice


Joined: 24 Aug 2006
Posts: 5

PostPosted: Thu Aug 24, 2006 1:01 pm    Post subject: need tcl script Reply with quote

bind time - * time:test; proc time:test {1} {if {[expr $m % 2]} {putserv "privmsg #eGc :test1"} {putserv "privmsg #eGc :test2"}}

how make that script work with eggdrop! Question that script me don't working whit eggdrop.. help plz (sry ban English Confused )
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Aug 24, 2006 1:44 pm    Post subject: Reply with quote

You hav'nt specified the value of $m...
Also, your proc does not take proper number of variables to be used with a time-binding

Finally, please put code inside code-blocks..
Code:
bind time - * time:test

proc time:test {minute hour day month year} {
 #setting m to 1 for demonstration
 set m 1

 if {[expr $m % 2]} {
  puthelp "PRIVMSG #eGc :test1"
 } {
  puthelp "PRIVMSG #eGc :test2"
 }
}


Of course, you'll have to set m to something useful, unless you're using it as a global variable (then you'll have to "global m" it first however)
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
swasteris
Voice


Joined: 24 Aug 2006
Posts: 5

PostPosted: Thu Aug 24, 2006 4:08 pm    Post subject: Reply with quote

very tnx Wink
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Thu Aug 24, 2006 10:39 pm    Post subject: Reply with quote

there's a little catch here: this won't work and will bail out with Tcl error on minute values of 08 and 09 as these aren't valid octal numbers

you can use [scan] to extract proper numerical values from [bind time] proc arguments
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
swasteris
Voice


Joined: 24 Aug 2006
Posts: 5

PostPosted: Fri Aug 25, 2006 3:55 am    Post subject: Reply with quote

something is ban working because in channel eggdrop bot write test1. so what wrong with that script?
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Aug 25, 2006 6:10 am    Post subject: Reply with quote

Yes... and as I stated, you'll have to do something useful with $m in the first place... I only set it to 1 for demonstation purposes...

This example assumes you wish to test wether the minute is even or not (as suggested by demond, and with his scan-fix)
Code:
bind time - * time:test

proc time:test {minute hour day month year} {
 if {[expr [scan $minute "%d"] % 2]} {
  puthelp "PRIVMSG #eGc :test1"
 } {
  puthelp "PRIVMSG #eGc :test2"
 }
}

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
swasteris
Voice


Joined: 24 Aug 2006
Posts: 5

PostPosted: Fri Aug 25, 2006 7:09 am    Post subject: Reply with quote

okey now it's work perfect Wink
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 -> Script Requests 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