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.

Problem With Adding flags to nicks that have [] in them

Old posts that have not been replied to for several years.
Locked
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Problem With Adding flags to nicks that have [] in them

Post by ^DooM^ »

Hi again. I have written a script to add members to my channel with a public trigger !addmember <nick> it works fine on normal nicks but some peoples nicks contain Square Braces ie [nutz] and the bot will not add flags to these users. it works on 1.6.16 windrop but refuses to work on 1.6.15 eggdrop. any ideas.

here is the bit code i cant get to work

Code: Select all

set newmember [lindex $arg 0]
set flags "X|Xao"
        chattr $newmember +$flags $chan
        setuser $newmember hosts $newhost
        putserv "NOTICE $newmember :You have been added to the bot. Welcome to our channel"
        save
        return 1
Thanks in advance
^DooM^ :wink:
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

split arg

Post by Sir_Fz »

use

Code: Select all

set newmember [lindex [split $arg] 0]
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

thanks i'll give it a try :mrgreen:
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Also, do check Peterre's "How to write eggdrop scripts that won't choke on special characters" page in order to understand things better.
Once the game is over, the king and the pawn go back in the same box.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Thanks for that caeser. Handy to have.

ok the fix Sir_Fz gave me worked great but now i have another Odd problem. its only adding 9 characters of a nick instead of the 14 it is even though i have set the nicklength in NET Type 5 to 32 characters. do i have to do anything specific to add users to the userlist with more than 9 characters in their nick?
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

First, learn how to consult the Search function of the forum before asking a question and second check this and this posts.
Once the game is over, the king and the pawn go back in the same box.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

erk sorry i forgot all about searching the forums for previous n00b questions. Sorry for being a dumbass :oops:
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Locked