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.

request?

Old posts that have not been replied to for several years.
m
mimic
Voice
Posts: 25
Joined: Wed Mar 12, 2003 10:34 pm

request?

Post by mimic »

Hello everyone,
I've tried and i mean this but i fear brackets :( . I tried to use bind nick (bind) so when my $botnick change to a specific nick it (putserv) trigger something like "I'm off" .. it's a temp nick and that means the bot went off . i still fear brackets

like the mirc commands if $nick == botoff

peace
m
mimic
Voice
Posts: 25
Joined: Wed Mar 12, 2003 10:34 pm

Post by mimic »

This is my useless code

Code: Select all

bind NICK - * offnick
proc offnick {nick uhost hand text} {
  if {$botnick == botoff } {
    putserv "PRIVMSG $chan I'm off"
  }
}
But i get this all the time
Tcl error [offnick]: called "offnick" with too many arguments

any ideas?
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

Try this:

Code: Select all


bind nick -|- "*" offnick
 
proc offnick {nick uhost handle channel newnick} {
  global botnick
  if {[$newnick == $botnick] && [$botnick == botoff]} {
    set chan [string tolower $channel]
    putserv "PRIVMSG $chan :I'm off"
  }
  return 0
} 

Remember that this is case-sensitive,
the Bots nick must be botoff, not Botoff

I hope it helps
I once was an intelligent young man, now i am old and i can not remember who i was.
m
mimic
Voice
Posts: 25
Joined: Wed Mar 12, 2003 10:34 pm

Post by mimic »

i got this error

Tcl error [offnick]: wrong # args: should be "botoff"

the nick was botoff , so it wasnt about the case-sensitive.

peace
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

Dedan wrote:

Code: Select all

  if {[$newnick == $botnick] && [$botnick == botoff]} {
 
remove the []s here.
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
m
mimic
Voice
Posts: 25
Joined: Wed Mar 12, 2003 10:34 pm

Post by mimic »

i got this now ..

Tcl error [offnick]: syntax error in expression "$newnick == $botnick && $botnick == botoff"
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

try this:

Code: Select all

bind nick -|- "*" offnick 

proc offnick {nick uhost handle channel newnick} { 
  global botnick 
  if {![$newnick == $botnick]} {return 0} 
  if {[$botnick == botoff]} { 
    set chan [string tolower $channel] 
    putserv "PRIVMSG $chan :I'm off" 
  } 
  return 0 
} 

I get that "syntax" error quite often, i correct it with brackets.

I hope this helps. 8)
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

try this instead:

Code: Select all

if {[string equal $newnick $botnick] || [string equal $botnick "botoff"]} {
m
mimic
Voice
Posts: 25
Joined: Wed Mar 12, 2003 10:34 pm

Post by mimic »

damn , i just begun and it turned out to be hard. what if i intend to write my own script , what would happen then? a lil small script since yesterday and i've acrossed heeps of errors :( .. not a good start not good at all.
i got this now
Tcl error [offnick]: called "offnick" with too many arguments.
lets make it simple.

this

Code: Select all

bind nick -|- "*" BOTNEW 

proc BOTNEW {nick uhost handle newnick} { 
  global botnick offnick
  if {$botnick == $newnick && $botnick == $offnick} { 
    putserv "PRIVMSG &owner :ITS NOT WORKING :("
  } 
  return 0 
} 
the code return nothing and i mean nothing at all and with same error
Tcl error [BOTNEW]: called "BOTNEW" with too many arguments.

peace
PS: $offnick is a var i intend to use in this code
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

try my last post
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

well, I see no use of this if {$botnick == $newnick && $botnick == $offnick} { confusion.

better if its just if {[string equal $newnick $offnick]} { instead or even if {$newnick == $offnick} { would be fine too.
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

Sir_Fz wrote:
better if its just if {[string equal $newnick $offnick]} {
instead or even if {$newnick == $offnick} { would be fine too.
"if {[string equal $newnick $offnick]} "
this would trigger the channel message anytime
ANYONE chose that nick , also
(offnick has not been assigned a value)

the same goes for:
" if {$newnick == $offnick} { "

string match -nocase might even be better

I still think my last post will work:

Code: Select all

bind nick -|- "*" offnick 

proc offnick {nick uhost handle channel newnick} { 
  global botnick 
  if {![$newnick == $botnick]} {return 0} 
  if {[$botnick == botoff]} { 
    set chan [string tolower $channel] 
    putserv "PRIVMSG $chan :I'm off" 
  } 
  return 0 
} 
give it a try 8)
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

mimic wrote:[snip]
peace
PS: $offnick is a var i intend to use in this code
that means $offnick is set in hist script.
but ur right about "this would trigger the channel message anytime
ANYONE chose that nick", didn't think about it.

but would be simpler like this:

Code: Select all

##set the bot's off nick
set offnick "botoff"

bind nick - * off:nick 

proc off:nick {nick uhost handle channel newnick} { 
global botnick offnick
  if {[string match -nocase $newnick $botnick] || [string match -nocase $botnick $offnick]} {
   foreach chan [channels] {
   putserv "PRIVMSG $chan :I'm off" 
    }
  } 
}
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

wouldn't "||" still return errors?
maybe "||" should be "&&"
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

"||" = "or"
"&&" = "and"

so in this case both can be used, since the two rules must apply in order for the proc to apply.

also u can remove the "foreach chan [channels] {" code, there is no use for it.

u can immediatly do a "putserv "PRIVMSG $channel :I'm off"" to make it simpler.
Locked