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.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

I think Dedan is right, because with ||, it will be true whenever a nick change occurs while the bot's nick is $offnick.
m
mimic
Voice
Posts: 25
Joined: Wed Mar 12, 2003 10:34 pm

Post by mimic »

I can remove $chan and add $owner right , to dedan's code? with no change to the entire script, that means i just change $chan with $owner? just for testing and to understand whats going on? and i still get errors "args" ?

dedan change your code so the msg could PRIVMSG the $owner , then i can see what's going on? remember the offnick is a var not a nick?

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

Post by arcane »

yes, it has to be "&&".
also, this

Code: Select all

if {$botnick == $newnick && $botnick == "offnick"} {
has to work. guess the problem were the missing ""s.

@dedan: [] are used in tcl to execute commands. means, using it the way you do will cause errors. the normal syntax is [command arguments], so your script will see $botnick (here "offnick") as a command. i don't know where you learned using []s, but i'd suggest to get some good tutorial.
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 »

look

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 
} 
return : Tcl error [BOTNEW]: called "BOTNEW" with too many arguments

the set code

Code: Select all

##set the bot's off nick 
set offnick "botoff"
and the bot still return errors? please everyone just edit this code forget the channel PRIVMSG. i want to undestand the easy way first? deal?

peace
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

mimic wrote: return : Tcl error [BOTNEW]: called "BOTNEW" with too many arguments
Read doc/tcl-commands.doc for the number of arguments you need to have for a nick bound procedure.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

from tcl-commands.tcl
NICK (stackable)
bind nick <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel> <newnick>

Description: triggered when someone changes nicknames. The mask
is matched against '#channel newnick' and can contain wildcards.
Module: irc
so the proc should be {nick uhost handle channel newnick}
whole code:

Code: Select all

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

# set owner's nick #
set owner "mimic"

bind nick - * BOTNEW 

proc BOTNEW {nick uhost handle channel newnick} { 
  global botnick offnick owner 
  if {$botnick == $newnick && $botnick == $offnick} { 
    putserv "PRIVMSG $owner :ITS NOT WORKING :(" 
  } 
}
this should work with no errors (simplest form)
m
mimic
Voice
Posts: 25
Joined: Wed Mar 12, 2003 10:34 pm

Post by mimic »

Sir_Fz your code doesn't return errors? but at the same time it doesn't PRIVMSG the owner? so no effect?
let me make it simple here i hope everyone understand mirc commands cause what i'm going to post is the same what i want in eggdrop

>>>

Code: Select all

on 1:nick:{
  if (%offnick isin $newnick) {
    .msg mimic hi there?
    .timer1 1 120 /msg Owner I'm using $offnick . and i'm off now.
  }
}
the timer will trigger once after 2mins from the first msg and will stop exactly after that.
I saw in tcl doc that thereis a "isbotnick" maybe this will help to find out whats the problem?

peace
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

did u try using the if {[string equal $newnick $botnick] && [string equal $offnick $botnick]} { ? or the if {[string match -nocase $newnick $botnick] && [string match -nocase $offnick $botnick]} { ??

please try them instead of if {$newnick == $botnick && ....} {
else I don't see any mistakes in the code.
m
mimic
Voice
Posts: 25
Joined: Wed Mar 12, 2003 10:34 pm

Post by mimic »

I dunno whats wrong with it ? i really dont know but as long as i really need it i will not give up, but the errors keeps buggin me . I appreciate what you did Sir_Fz i really do you and the others but with the codes you and other have wrote here. some with errors and some wasn't really work .

my last post as you can see i wrote an mIRC code which i need to convert to tcl to make it work exactly like i want with the timer and killtimer after excuting the needed cmd ..

Thanks
peace
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

putserv "PRIVMSG $owner :ITS NOT WORKING : ("
does the ":" or the "(" need to be escaped?
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 »

dunno what you mean dedan ? but if youre tryin to write the code i want with utimer and killutimer . like the mIRC code i post above . please do now . Thanks
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

mimic wrote:please do now.
Well atleast he gives orders with a 'please' :roll:
m
mimic
Voice
Posts: 25
Joined: Wed Mar 12, 2003 10:34 pm

Post by mimic »

it's not an order . i said if youre trying to write a code please do now. that's mean IF . clear enough eh?

peace
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

mimic, the code given to you, must work and is exactly what you need.

u can add a timer of 2 mins (=120secs) and it doesn't need to be killed.

you have to figure out what's making it useless.
Locked