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.

transfer of variables

Old posts that have not been replied to for several years.
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

transfer of variables

Post by Buffy_25 »

Hi,

I have two bots in my channel.

Let's say the first bot is online and has some variables running (i.e. %school(%student)...how can i pass all those runned variables from my first bot, to my second bot when he islinked? (so transfering all the existing variables of %school to second bot)

Thnx.

Best regards,

Buffy
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind msg - var add:var

proc add:var {nick uhost hand arg} {
global [lindex [split $arg] 0]
set [lindex [split $arg] 0] "[join [lrange [split $arg] 1 end]]"
}
when someone messages your bot var varname elements the bot will set a new variable with the name you specify in varname and add elements into it. Also it will be called globally so you can use it anywhere you want in the bot.
note that you can specify flags in the bind instead of "-"
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

Post by Buffy_25 »

Thnx a lot Sir_Fz!

Regards,

Buffy
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You're welcome.

I forgot to tell you that when you rehash/restart, the variables will be deleted.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You also niglected to mention it is pretty damned insecure, even with flag protection.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I guess that if you give a custom flag and fixed masks into the handle such as *!ident@host. It won't be so insecure.

Besides, nobody has to know that you can add vars to your bot through msg command :P
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

He was talking about the bind msg - var add:var, as you can see it's for ANYONE not ONLY for known users. Replace the - with an custrom flag that suits your needs.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Caesar, Ppslim did say "even with flag protection" and I did say "note that you can specify flags in the bind instead of -"
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Actualy yes, I understand now what he realy meant to say.. Well, that variables changing is realy damned insecure as he said. For instance, someone can change the owner of the eggdrop by just using that code. You got to be damn stupid to load something like that on your eggdrop. :mrgreen:
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

yeah you're right about that. But as I said before, nobody has to know that there exists such a command in the bot :P
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Not telling anybody is a very idiotic way to look at security.

What would make more sence is to use what Tcl calls an array. IE, you only populate a single array, where the name is an array key and then the value.

Although chaging settings at will is still insecure, damage limitation is for more managable
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

He doesn't seem to care ?
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

From reading the initial problem... I don't even understand how the solution provided was remotely related to the original quandry...

I would have suspected a solution along the lines consisting of "bind link", "putbot", etc...
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I never used those two, So I don't have any experiance with them to offer them in the solution. But, I'm sure there can be a better solution.
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

Post by Buffy_25 »

Thnx guys to try to help me out with this item.

I will try with those remarks written above.
I'll keep you advised!

Best regards,

Buffy
Locked