mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
I have a script that sets up variables when a combo box is either turned On or Off
it saves the variables to my bots script folder in the "Remote.ini" file.

My question is

Can i get that script, if i copy the script into my mirc scripts folder, and using the
/dialog -m bla bla, set and save the variables to On or Off, and have it write to the bot`s remote.ini file ?

My setup has changed in the way i setup my folders, so for an example i have the following folders

mirc\shadowdemon\scripts (this is where i run my copy of installed mirc, and it`s scripts)
mirc\botname\scripts (my bots scripting folder)
mirc\botname\remote.ini (the location of my remote.ini is kept in the bots root folder)

I hope somebody can shed some light on this, as i have been reading mirc`s /writeini section, all
to no avail.

If it`s not possible or would be a bad thing, due to hackers maybe writing stupid scripts that control
other .ini files, then please let me know, and i will drop the question, just means that if i want to
turn on or off the variables, means i have to keep returning to my bots screen and switch them myself.

Thanks
ShadowDemon
mIRC V6.03


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
$scriptdir
Returns the directory of the currently executing remote script.

writeini $scriptdirMyFile.ini section item value
var %x = $readini($scriptdirMyFile.ini, section, item)


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
I`m sorry Hammer, but i feel a bit stupid, been trying for the past 10 minutes to figure this out, but ....

Part of my Code, for setting up the variables (i think this is the part of the script you need, as that sets up the variables)
Code:
on *:dialog:isrun:sclick:1: {
  if ($did == 1) && ($did(1).seltext == on) { set %serveron on }
  elseif ($did == 1) && ($did(1).seltext == off) { set %serveron off }
}


Where exactly does the following go ?

writeini $scriptdirMyFile.ini section item value
var %x = $readini($scriptdirMyFile.ini, section, item)


i`m unsure what the section, item and value are for confused blush

Thanks for your help
ShadowDemon


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Are you trying to move your bot's %variables file?
Alt-R (Remotes) / Variables tab / File / Save As / surf to the directory you want (I renamed my variables file to variables.txt).

Or are you going to be using an INI file to store your data?
When you use /writeini and and $readini() to save/retrieve your data, simply include the $scriptdir on the front of the data file name. $scriptdirMyDataFile.ini

If neither of these answers your question, tell me where I'm misunderstanding what you are really trying to do.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Haha, i`ll try explain grin

Ok, i have two copies of mIRC running, one is setup for me, my own personal scripts n stuff, the other is setup for my bot that i`m making, it has other scripts for protection and an 8ball n stuff.

I have a script that when a user comes into the channel and types an event keyword, the bot looks at the variables in it`s remote.ini file, and then tells a user if an app is running or not.

Now in order for me to change the variables i have to switch to my bot`s screen and setup the variable that way, but then i thought could i not just move the script to my own personal scripts folder and add that to my remotes, but when i then save the variables i want it to save to my bots remote.ini file, so that when a user types teh keyword event, it displays if the app is running or not, perhaps if i made a varaibles .txt file, just for the bot or whatever as long as the bot displays the text, as if it was responding to a user, cos sometimes i might not be in at home, but still leave the bot running (i`m on cable modem)
I can then set the varaibles on my personal screen before i quit mIRC or whatever.

Thanks once again for yer help, and i understand yer busy with others, so i`ll wait for yer answer. wink

ShadowDemon


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
What you want is an interface to tell your BOT to make the required changes to its variables. You cannot share the same variables.ini file with your bot that's running on a different mIRC or you WILL get unpredictable results. A much better idea is for you to tell YOUR script which variables it needs to update in the bot, then have your script send the bot a command string (or strings) telling it which variables to update and what to update them to.
  • You could do this through a simple on TEXT or ctcp event across the IRC server.
  • You could do this through DDE if you didn't want to do it across the IRC server, if you wanted to. DDE uses Windows to message another running process on the same computer.
  • You could have your bot check a certain file occasionally to see if there are any requested changes to be made.
In all cases, tell your bot to set the appropriate values into its variables; part of the point of moving the bots scripts/variables off into another running mIRC is to separate your data from its data.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Ok, i got ya, lol. smile

I`ll try with the ONTEXT event and with the CTCP.

Yeah i understand that i would get unpredictable results by writing to .ini file.

Thanks Hammer for your help, i`ll just mess around with the scripting for the events, if not i`ll just do what i`m currently doing, and that is switching to the bot and setting up the variables.

ShadowDemon


Never argue with an idiot...they'll drag you down to their level and beat you up with experience

Link Copied to Clipboard