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 

utimer problem?

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


Joined: 14 Nov 2005
Posts: 47
Location: Netherlands

PostPosted: Mon Jan 16, 2006 1:20 pm    Post subject: utimer problem? Reply with quote

I have this script:

Code:
putquick "NOTICE $nick :You invited me to join \002$chan\002. Joining..."
putquick "PRIVMSG #bots :Joining \002$chan\002 - Invited in by \002$nick\002"
channel add $chan
utimer 10 [putquick "PRIVMSG OperServ :mode $chan +o $botnick"]


It is about the last sentence, that utimer.
Sometimes it works (it IMMEDIATELY send it to operserv, not 10 seconds), and sometime it doesn't work at all.

Can anyone explain what I am doing wrong here?

Thanks in advance,

T-Xorcist
_________________
is-1337.org IRC server!
Back to top
View user's profile Send private message Visit poster's website
nANDu
Voice


Joined: 22 May 2005
Posts: 15

PostPosted: Mon Jan 16, 2006 2:13 pm    Post subject: Reply with quote

Code:

utimer 10 [list putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
Back to top
View user's profile Send private message
demond
Revered One


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

PostPosted: Mon Jan 16, 2006 2:19 pm    Post subject: Reply with quote

Code:

utimer 10 {putquick "PRIVMSG OperServ :mode $chan +o $botnick"}

_________________
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
T-Xorcist
Halfop


Joined: 14 Nov 2005
Posts: 47
Location: Netherlands

PostPosted: Mon Jan 16, 2006 2:25 pm    Post subject: Reply with quote

nANDu wrote:
Code:

utimer 10 [list putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
This 1 works fine. What is the difference with yours demond?

What is the "official" way?

And can I build an IF function into a timer? Embarassed Is that possible?
_________________
is-1337.org IRC server!
Back to top
View user's profile Send private message Visit poster's website
demond
Revered One


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

PostPosted: Mon Jan 16, 2006 2:29 pm    Post subject: Reply with quote

no difference, they are equivalent, I was a bit late on "Submit" button

put your if logic in a proc, run that proc by timer
_________________
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
T-Xorcist
Halfop


Joined: 14 Nov 2005
Posts: 47
Location: Netherlands

PostPosted: Mon Jan 16, 2006 9:49 pm    Post subject: Reply with quote

How do I do this exacly :$

I have this:
Code:
utimer 4 [list check:ops $chan $nick]

and tried this:
Code:
utimer 4 [list check:ops]


And it MUST go to this procedure:
Code:
proc check:ops {nick host hand text} {
  if {([isop $nick $chan])} {
    putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
  } else {
    putquick "PRIVMSG $chan :Leaving channel... (Requester doesn't have ops) \002#bots\002"
    channel remove $chan
  }
}

_________________
is-1337.org IRC server!
Back to top
View user's profile Send private message Visit poster's website
demond
Revered One


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

PostPosted: Mon Jan 16, 2006 10:05 pm    Post subject: Reply with quote

you MUST pass to [utimer] all the arguments your proc needs:
Code:

proc foo {x y z} {
...
}

...

utimer $t [list foo $x $y $z]

_________________
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
T-Xorcist
Halfop


Joined: 14 Nov 2005
Posts: 47
Location: Netherlands

PostPosted: Mon Jan 16, 2006 10:11 pm    Post subject: Reply with quote

so:

Code:
utimer 4 [list check:ops $nick $host $hand $text]


All of this?

I tried this one aswell:
Code:
putquick "NOTICE $nick :You invited me to join \002$chan\002. Joining..."
putquick "PRIVMSG #bots :Joining \002$chan\002 - Invited in by \002$nick\002"
channel add $chan
utimer 4 {
  if {([isop $nick $chan])} {
    putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
  } else {
    putquick "PRIVMSG $chan :Leaving channel... (Requester doesn't have ops) \002#bots\002"
    channel remove $chan
  }
}


But that doesn't seem to work Sad
Anyone?
_________________
is-1337.org IRC server!
Back to top
View user's profile Send private message Visit poster's website
nANDu
Voice


Joined: 22 May 2005
Posts: 15

PostPosted: Tue Jan 17, 2006 5:47 pm    Post subject: Reply with quote

Pls read what demond posted again

Code:

proc check:ops {nick host hand text} {
   if {([isop $nick $chan])} {
   ......
   ......
   }
}


Code:

....
....
putquick "NOTICE $nick :You invited me to join \002$chan\002. Joining..."
putquick "PRIVMSG #bots :Joining \002$chan\002 - Invited in by \002$nick\002"
channel add $chan
utimer 4 [list check:ops $nick $host $hand $text]
Back to top
View user's profile Send private message
T-Xorcist
Halfop


Joined: 14 Nov 2005
Posts: 47
Location: Netherlands

PostPosted: Tue Jan 17, 2006 6:12 pm    Post subject: Reply with quote

As you can read, I allready tried this, but it doesn't work...

I get these two lines in my error log:

Code:
[23:10] Tcl error in script for 'timer2':
[23:10] extra characters after close-quote

_________________
is-1337.org IRC server!
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: Tue Jan 17, 2006 7:42 pm    Post subject: Reply with quote

T-Xorcist wrote:
How do I do this exacly :$

I have this:
Code:
utimer 4 [list check:ops $chan $nick]

and tried this:
Code:
utimer 4 [list check:ops]


And it MUST go to this procedure:
Code:
proc check:ops {nick host hand text} {
  if {([isop $nick $chan])} {
    putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
  } else {
    putquick "PRIVMSG $chan :Leaving channel... (Requester doesn't have ops) \002#bots\002"
    channel remove $chan
  }
}

Use
Code:
utimer 4 [list check:ops $chan $nick]

and
Code:
proc check:ops {chan nick} {
 global botnick
 if {([isop $nick $chan])} {
  putquick "PRIVMSG OperServ :mode $chan +o $botnick"
 } else {
  putquick "PRIVMSG $chan :Leaving channel... (Requester doesn't have ops) \002#bots\002"
  channel remove $chan
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
T-Xorcist
Halfop


Joined: 14 Nov 2005
Posts: 47
Location: Netherlands

PostPosted: Tue Jan 17, 2006 9:55 pm    Post subject: Reply with quote

Well Sir_Fz, it goes to that procedure... thanks for that.

Only.. It allways say that I haven't got @ in the channel, and then parts.

Do you have any idea of what I am doing wrong? I guess the code is ok?

if I do this:
Code:
} else {
    putquick "PRIVMSG $chan :Nick = $nick"
    putquick "PRIVMSG $chan :Chan = $chan"
    putquick "PRIVMSG $chan :Leaving channel... (Requester doesn't have ops) \002#bots\002"
    channel remove $chan
  }


It does give me the right nickname and channel.
_________________
is-1337.org IRC server!
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