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.

my anti /msg LOGIN script .. (help one thing needed to be fi

Old posts that have not been replied to for several years.
Locked
T
TRiNuX

Post by TRiNuX »

Hey...
I just wrote my first TCL script.. after several hours of trying to get the syntax right, I finally got it working...

Basically when you use /msg bot login YOUR-PASS .. it will notice the user with a set message saying somthing like 'Im not a stormbot'.

The problem I'm having is that I cant set the variable for the set msg outside the procedure:

-- HERES MY CODE --

bind msg * login nologinsoz

proc nologinsoz {nick args} {

set nologinmsg "Idiot! I'm not a Stormbot! you cant login like this!"

set nologinidiot $nick
puthelp "NOTICE $nick :$nologinmsg"
return 0
}

What do i have to change so I could set the 'nologinmsg' variable outside the procedure? THNX!

(btw the 'set nologinidiot $nick' is for another part of the script where the person who tried it's nick can be recalled, not yet done that bit tho)

ta
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Try the following

Code: Select all

set nologinmsg "Idiot! I'm not a Stormbot! you cant login like this!"
bind msg * login nologinsoz
proc nologinsoz {nick args} {
  global nologinmsg
  set nologinidiot $nick
  puthelp "NOTICE $nick :$nologinmsg"
  return 0
}
T
TRiNuX

Post by TRiNuX »

That was what my original code was... the bot just says

<^Testb0t^> [14:45] Tcl error [nologinsoz]: can't read "nologinmsg": no such variable

:sad:
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Case matters, eg: MaTTerS is different to matters.

Otherwise, the only other problem, is there is a unset command somwhere further down in the code (maybe another file, but it is loaded after this file).

If the variable is created globaly, it is available to all commands, if called for global use. The only time you should get this error, is if the variable was never created (no set command creating a default), or if it was created, but destroyed with unset command.

I would need to see the whole of your code, if I am to tell you where the problem lies. If the code is longer than 20 lines, try putting onto some web-space, and paste the address. Large files waste the forum, and can cause small problems.
Locked