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.

need help

Old posts that have not been replied to for several years.
Locked
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

need help

Post by Pitchat »

i did a little script , when an owner type .enfer (nick ) it suppose to give the user the flag +E then send the user in chan 666 on the partyline and lock him in until he say a certain sentence after that the +E is remove and the user send back to the partyline .

heres the problem the script doesnt set the +E flag so the user can escape anytime

Code: Select all

# BINDS
# -----
bind filt E * filt:enfer
bind chjn - * chjn:enfer
bind chon E * chon:enfer
bind dcc m enfer dcc:enfer

# CODE
# ----
proc filt:enfer {idx text} {
	if {[string tolower $text] == "i will not do bad things"} {
		chattr [idx2hand $idx] -E
		putdcc $idx "so soon? ok, youre back on the partyline"
		setchan $idx 0
		return
	} {
		putdcc $idx "nice try !"
		return
	}
}


proc chjn:enfer {bot hand chan flag idx from} {
	if {$chan == "666"} {
		if {![matchattr $hand m]} {chattr [idx2hand $idx]  +E}
		putdcc $idx "welcome in hell bad boy?"
		putdcc $idx "you have two choices , you stay here with me or you say \"i will not do bad things\"... the choice is yours!"
	}
}


proc chon:enfer {hand idx} {
	setchan $idx 666
	return
}



proc dcc:enfer {hand idx arg} {
	set idx [hand2idx [lindex $arg 0] ]
	if {[valididx $idx]} {
		setchan $idx 666
		return 1
	} {
		putdcc $idx "[lindex $arg 0] is not a valid partyline user."
		return 0
	}
}
any help welcome

Pitchat
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

if {![matchattr $hand m]} {chattr [idx2hand $idx]  +E}
you have two blank spaces between [idx2hand $idx] and +E
remove one of them and try again
Elen sila lúmenn' omentielvo
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

still dont work

:(
User avatar
TALES
Halfop
Posts: 59
Joined: Sun Nov 09, 2003 8:45 am
Location: Netherlands
Contact:

Post by TALES »

Should there be any else between } { ??

this:

Code: Select all

 return 
   } { 
      putdcc $idx "nice try !" 
to this:

Code: Select all

 return 
   } else { 
      putdcc $idx "nice try !"
and this:

Code: Select all

 return 1 
   } { 
      putdcc $idx "[lindex $arg 0] is not a valid partyline user." 
to this:

Code: Select all

 return 1 
   } else { 
      putdcc $idx "[lindex $arg 0] is not a valid partyline user." 
not shure but could be
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

} { same as } else {
User avatar
TALES
Halfop
Posts: 59
Joined: Sun Nov 09, 2003 8:45 am
Location: Netherlands
Contact:

never

Post by TALES »

i have never seen that in a tcl Sir_Fz. maybe i did not notice that :-?
i learn everyday something new ;)
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

sorry to say that it doesnt work either with ou without the " else"

i dont know where to look now i`m totally confused

thanks for your help

Pitchat
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Code: Select all

proc dcc:enfer {hand idx arg} {
   set victim [lindex [split $arg] 0]
   set victimidx [hand2idx $victim]
   if {[valididx $victimidx]} {
      chattr $victim +E
      setchan $victimidx 666
      return 1
   } else {
      putdcc $idx "$victim is not a valid partyline user."
      return 0
   }
} 
Try that for starters. At least it sets +E.

Also, did you test the code with a normal user (without +m)?
Locked