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.

pm user if raw 307 is null

Help for those learning Tcl or writing their own scripts.
m
mikey2
Voice
Posts: 19
Joined: Thu Aug 18, 2005 4:39 pm

Post by mikey2 »

ok...so far so good :)

Next, I would like to add a 5 min. ban for non-reg. users (after they get the pm, of course). (3) attempts to join in 24 hours without registering gets a permanent ban.
w
wonka071
Voice
Posts: 13
Joined: Sun Aug 27, 2006 9:33 pm

Post by wonka071 »

thx for the script
would like to add use /msg NickServ REGISTER yourpassword youremail
to REGISTER
use /msg NIckServ IDENTIFY yourpassword to ID it you are REGISTERED

puthelp "privmsg $n :please identify or register your nick"
Should I added it here ?
}
}
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

try it and see for yourself, don't wait for somebody to approve your trials
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
w
wonka071
Voice
Posts: 13
Joined: Sun Aug 27, 2006 9:33 pm

Post by wonka071 »

changed the script like this

bind join - * foo
proc foo {n u h c} {
puthelp "whois $n"
}
bind raw - 311 got311 ;# first WHOIS reply
bind raw - 307 got307 ;# nick has identified (registered)
bind raw - 318 got318 ;# End of /WHOIS list
proc got311 {f k t} {
set n [lindex [split $t] 1]
set ::whoised($n) 0
}
proc got307 {f k t} {
set n [lindex [split $t] 1]
incr ::whoised($n)
}
proc got318 {f k t} {
set n [lindex [split $t] 1]
if {$::whoised($n) == 0} {
puthelp "privmsg $n :please identify or register your nick" U can register your nick with this (/msg NickServ REGISTER yourpassword youremail) without the ()
Also you can use this to identify yourself if you already registered (/msg NickServ IDENTIFY yourpass) without the ()
}
}
putlog "nickreg loaded"
get this error from the bot
Tcl error [got318]: wrong # args: should be "puthelp text ?options?"
Can somebody help thx
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Please use code-blocks for code snippets.. (and indenting it would also be nice)

The cause for the problem, is that you try to use " in your message without escaping it, thus tcl think it's the end of the string, and starts parsing a new argument.
Quick-fix, put a \ infront of any " within the string (not the ones marking the start and end of string tho)
NML_375
w
wonka071
Voice
Posts: 13
Joined: Sun Aug 27, 2006 9:33 pm

Post by wonka071 »

kk changed it to this :
bind join - * foo
proc foo {n u h c} {
puthelp "whois $n"
}
bind raw - 311 got311 ;# first WHOIS reply
bind raw - 307 got307 ;# nick has identified (registered)
bind raw - 318 got318 ;# End of /WHOIS list
proc got311 {f k t} {
set n [lindex [split $t] 1]
set ::whoised($n) 0
}
proc got307 {f k t} {
set n [lindex [split $t] 1]
incr ::whoised($n)
}
proc got318 {f k t} {
set n [lindex [split $t] 1]
if {$::whoised($n) == 0} {
puthelp "privmsg $n :please identify or register your nick U can register your nick with this (/msg NickServ REGISTER yourpassword youremail) without the ()
Also you can use this to identify yourself if you already registered (/msg NickServ IDENTIFY yourpass) without the ()"
}
}
putlog "nickreg loaded"
but this line not showing up
Also you can use this to identify yourself if you already registered (/msg NickServ IDENTIFY yourpass) without the ()
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

*edited* thanks to nml375

Try:

Code: Select all

bind join - * foo

proc foo {n u h c} {
  puthelp "whois $n"
}

bind raw - 311 gotraw ;# first WHOIS reply
bind raw - 307 gotraw ;# nick has identified (registered)
bind raw - 318 gotraw ;# End of /WHOIS list

proc gotraw {f k t} {
  global whoised
  set n [lindex [split $t] 1]
  if {$k == "311"} {
    set whoised($n) "0"
  } elseif {$k == "307"} {
    incr whoised($n)
  } elseif {$k == "318"} {
    if {$whoised($n) == "0"} {
      puthelp "privmsg $n :please identify or register your nick U can register your nick with this (/msg NickServ REGISTER yourpassword youremail) without the ()."
      puthelp "privmsg $n :Also you can use this to identify yourself if you already registered (/msg NickServ IDENTIFY yourpass) without the ()."
    }
  }
}
putlog "nickreg loaded"
Not tested, but should work.
Last edited by r0t3n on Thu Sep 07, 2006 5:25 pm, edited 1 time in total.
r0t3n @ #r0t3n @ Quakenet
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

@Tosser^^: Keep track of your variable names.. (no variable named arg defined anywhere within "gotraw").

@wonka071: You can't insert newlines in privmsgs.. you'll have to issue another

Code: Select all

puthelp "PRIVMSG $n :blah..."
for the second line if you want it on a separate line... (see Tosser^^'s example on this). And once again, please use [ code] [/code]-blocks when you post code...
NML_375
Post Reply