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 

raw 307 return

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
gembels
Voice


Joined: 07 Jul 2012
Posts: 26

PostPosted: Sun May 08, 2016 7:59 am    Post subject: raw 307 return Reply with quote

Hi,

the result always "$nick, please identify before transfer" and "$nick identified"

can someone explain to me what happen please ?

Thanks in advance

Code:

set tgchan1                                      "#jakarta"
set tgcmdrankx1                          "!trf*"
set tgflagsrankx1                                "m|m"

bind pubm $tgflagsrankx1 "$tgchan1 %$tgcmdrankx1" bankd

bind raw -|- "307" whoisbalas

proc whoisbalas {from key text} {
global chkreg botnick
set nick [lindex $text 1]
if {$nick == $botnick} { return 0 }
putlog "NICK $nick IS IDENTIFY..!"
if {[info exists chkreg($nick)]} {
        set chkreg($nick) "0"
        }
}



proc whoisdia {text} {
    putserv "WHOIS $text $text"
}


proc bankd {nick host hand chan text} {
global chkreg
whoisdia $nick
privmsg $chan "Debug: $chkreg($nick)"
if {$chkreg($nick) != "0"} (    tggamemsg1 "$nick, please identify before transfer"
                                unset chkreg($nick)
                                return } else { tggamemsg1 "$nick identified" }

   return 0
}
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sun May 08, 2016 10:52 am    Post subject: Reply with quote

Found one typo on this line...
Code:
if {$chkreg($nick) != "0"} (    tggamemsg1 "$nick, please identify before transfer"

You used an open parenthesis '(' where you need an open brace '{'
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
gembels
Voice


Joined: 07 Jul 2012
Posts: 26

PostPosted: Mon May 09, 2016 9:53 am    Post subject: Reply with quote

thank you so much for your help SpiKe.. silly me
Back to top
View user's profile Send private message
gembels
Voice


Joined: 07 Jul 2012
Posts: 26

PostPosted: Fri May 13, 2016 9:10 am    Post subject: Reply with quote

@SpiKe^^

i try to put

Code:

if {![info exists chkreg($nick)]} {
        set chkreg($nick) "1"
        }


its always saying "please identify before transfer" at the first then if they try second time it work.. you have any idea why ?

I think its because "whoisdia $nick" didn't response earlier than [info exists chkreg($nick)] ?
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri May 13, 2016 10:22 am    Post subject: Reply with quote

Yes, to "fix" this you could add a timer to allow the 307 get triggered first.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
gembels
Voice


Joined: 07 Jul 2012
Posts: 26

PostPosted: Sun May 15, 2016 2:31 am    Post subject: Reply with quote

caesar wrote:
Yes, to "fix" this you could add a timer to allow the 307 get triggered first.


how do you do that ? on tcl there is no "goto" command.. do I need use while or separate the proc to calling after that.. which one is the best practise between of this 2 below ?


1. .....
Code:

set tgchan1                                      "#jakarta"
set tgcmdrankx1                          "!trf*"
set tgflagsrankx1                                "m|m"

bind pubm $tgflagsrankx1 "$tgchan1 %$tgcmdrankx1" bankd

bind raw -|- "307" whoisbalas

proc whoisbalas {from key text} {
global chkreg botnick chan
set nick [lindex $text 1]
if {$nick == $botnick} { return 0 }
putlog "NICK $nick IS IDENTIFY..!"
if {[info exists chkreg($nick)]} {
        set chkreg($nick) "0"
        }

response nick chan

}



proc whoisdia {text} {
    putserv "WHOIS $text $text"
}


proc bankd {nick host hand chan text} {
  whoisdia $nick $chan
}


proc response {nick arg} {
global chkreg
privmsg $arg "Debug: $chkreg($nick)"
if {$chkreg($nick) != "0"} (    tggamemsg1 "$nick, please identify before transfer"
                                unset chkreg($nick)
                                return } else { tggamemsg1 "$nick identified" }

   return 0
}



or


2. .....
Code:

set tgchan1                                      "#jakarta"
set tgcmdrankx1                          "!trf*"
set tgflagsrankx1                                "m|m"

bind pubm $tgflagsrankx1 "$tgchan1 %$tgcmdrankx1" bankd

bind raw -|- "307" whoisbalas

proc whoisbalas {from key text} {
global chkreg botnick chan
set nick [lindex $text 1]
if {$nick == $botnick} { return 0 }
putlog "NICK $nick IS IDENTIFY..!"
if {[info exists chkreg($nick)]} {
        set chkreg($nick) "0"
        }



}



proc whoisdia {text} {
    putserv "WHOIS $text $text"
}


proc bankd {nick host hand chan text} {
 global chkreg
 whoisdia $nick
 privmsg $arg "Debug: $chkreg($nick)"
 utimer 5 [checked $nick]

}

proc checked {arg} {
global chkreg
if {$chkreg($arg) != "0"} (    tggamemsg1 "$arg, please identify before transfer"
                                unset chkreg($arg)
                                return } else { tggamemsg1 "$arg identified" }

}


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
Page 1 of 1

 
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