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 

pm user if raw 307 is null
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
mikey2
Voice


Joined: 18 Aug 2005
Posts: 19

PostPosted: Fri Aug 19, 2005 3:27 am    Post subject: Reply with quote

ok...so far so good Smile

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.
Back to top
View user's profile Send private message
wonka071
Voice


Joined: 27 Aug 2006
Posts: 13

PostPosted: Sun Sep 03, 2006 12:15 pm    Post subject: Reply with quote

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 ?
}
}
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 Sep 04, 2006 12:16 am    Post subject: Reply with quote

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] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
wonka071
Voice


Joined: 27 Aug 2006
Posts: 13

PostPosted: Wed Sep 06, 2006 3:52 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Sep 06, 2006 4:25 pm    Post subject: Reply with quote

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, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
wonka071
Voice


Joined: 27 Aug 2006
Posts: 13

PostPosted: Wed Sep 06, 2006 7:59 pm    Post subject: Reply with quote

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 ()
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Thu Sep 07, 2006 4:40 am    Post subject: Reply with quote

*edited* thanks to nml375

Try:

Code:
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.
_________________
r0t3n @ #r0t3n @ Quakenet


Last edited by r0t3n on Thu Sep 07, 2006 5:25 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Sep 07, 2006 1:26 pm    Post subject: Reply with quote

@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:
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, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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