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.

How to grab the 2nd word as a variable? (For Triggers)

Help for those learning Tcl or writing their own scripts.
Post Reply
M
Mysticales
Voice
Posts: 26
Joined: Tue Oct 18, 2011 5:33 pm

How to grab the 2nd word as a variable? (For Triggers)

Post by Mysticales »

Hello, On my old bot it was simple to make it read the 2nd, 3rd, 4th word of a trigger command. (Example !trigger First Second Third)

Well on the script its already reading the 1st thing after it (Which turns the game on or off) But I am trying to add and improve on that, to make it where if the user turns the game on and adds a number to the end of the trigger, it would apply that as a variable to use in the script. I just spent some time on google between binds, variables and so, however I dont know what eggdrop really calls that, I assumed something with $aug or so, thing is, since aug is already being used, just need somehow to read the variable after that one.

Any guide or place for me to read up on something like this? Thanks. =)
~Battlez-avec la Mystique?~
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

Possibly bind pub , and split the text?

http://www.eggheads.org/support/egghtml ... mands.html
and scroll down to
bind pub

Then:
http://www.tcl.tk/man/tcl8.5/TclCmd/split.htm
and
http://www.tcl.tk/man/tcl8.5/TclCmd/lindex.htm


Here are some links that I think are very good, for getting started with TCL for Eggdrop:

http://suninet.the-demon.de/
http://www.eggheads.org/support/egghtml ... mands.html
http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm

With those three, you can do a LOT. :)

I hope that helps.
User avatar
spithash
Master
Posts: 249
Joined: Thu Jul 12, 2007 9:21 am
Location: Libera
Contact:

Post by spithash »

is this a script release? can you read where you post stuff?
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
M
Mysticales
Voice
Posts: 26
Joined: Tue Oct 18, 2011 5:33 pm

Post by Mysticales »

Actually, thats a good question. You see, its not my script, its one that was already posted to the archives that I am trying to alter to make better. So the question is, is this kinda topic more for script support since its based on one already released. Or script help. But the way I read script help, is if I was making one from scratch that is 100% my own work. Which I am not claiming to.

(Tho been meaning to ask about that, if I alter a script to make improvements on a script that has had no updates in a year or so, am I allowed to release one with the updates?)
~Battlez-avec la Mystique?~
Post Reply