mIRC Homepage
Posted By: Krayzee Load script - 25/05/04 05:19 PM
i would like to see a load script function for online scripts like online timers.

with this function u could load a script that is only availble while your connected to the server it was loaded on.

EG

on *:connect: {

if ($network == mynetwork) {
.load -rs -o my_online_script.ini
}

}

the -o would mean its online only when the server disconnects it unloads the script automaticaly.
Posted By: Mentality Re: Load script - 25/05/04 10:12 PM
Interesting idea, but wouldn't this easily be scripted with the on disconnect event?

Whilst not impossible (nothing is!) things that are easy to script already are less likely to get in as a feature - the mIRC Scripting language is a feature in itself.

Regards,
Posted By: Netchelandorious Re: Load script - 26/05/04 01:04 AM
why don't you try this?

on *:connect: { .enable #mygroup }
on *:disconnect: { .disable #mygroup }

is that the effect you're looking for?
Posted By: Krayzee Re: Load script - 26/05/04 12:02 PM
part of the idea was to keep script that arnt needed untill u r connected from taking up memory. You may only need some scripts on certain networks.

i have already scripted it but thought a addition to the load command would be better and easier.

think if u had 20 scripts for 1 network then 20 for another etc etc would be a pain of keeping track of which network the script was loaded for.
Posted By: Mentality Re: Load script - 26/05/04 12:55 PM
Quote:
You may only need some scripts on certain networks.


if ($network == networkname) { do stuff }

Quote:
think if u had 20 scripts for 1 network then 20 for another etc etc would be a pain of keeping track of which network the script was loaded for.


Why would you have 20 scripts for one network, and 20 for another? I just can't see the point of that. Infact, why do you even need to unload it at all? If you use something like if ($network == networkname) then you should be able to get things to only execute on one network, then you could keep them loaded all the time and connect as usual. As scripts do not do anything when mIRC is closed, loaded or unloaded, I don't see why you'd need to unload scripts on disconnect. CPU usage shouldn't be an issue really...

To separate the connect/disconnect events for each network, just put them in different remote files and name the .mrc files 'NetworkName'. You can then easily access them from the 'View' menu of ALT+R.

As this post says:

"Would it be easy to write a script for my idea?
If it's something that is very easy to do with scripts, chances are it won't be built into mIRC. (This isn't always the case, but should be considered when posting your idea.)"


My 2 cents.

Regards,
Posted By: Krayzee Re: Load script - 28/05/04 10:52 PM
the 20 scripts was a example.

this is why i say it would be useful to unload scripts when u disconnect from a network.

ok i have menus for all the commands for chanserv, nickserv, memoserv and x etc for different networks. now not all the networks have the same commands even though they r still chanserv and nickserv etc.

so on connect i load the script for the right network. but if i was to leave them load for ever network i have the commands for then this would mean a lot of scripts loaded that i dont use all the time.

also when im trying to edit my scripts i have to scroll through all of them to find the 1 i want.

so it would seem to make sence to only load the scripts as and when i need them and not to keep them load all the time which would mean more memory usage, more CPU usage and a slower mIRC.
© mIRC Discussion Forums