mIRC Home    About    Download    Register    News    Help

Print Thread
on load event #93939 13/08/04 02:00 AM
Joined: Jul 2004
Posts: 169
S
ShinZon Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jul 2004
Posts: 169
mirc 6.03

Format: on <level>:LOAD:<commands>
Example: on 1:LOAD:/echo mIRC Script Loaded!

is there a way to do something like this:


ON:LOAD: {
IF $scriptdir\File.ini IS loaded then do something
}

does some script/code like this exist, where i can specify what happens if exact file was loaded ?

Re: on load event #93940 13/08/04 04:06 AM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
How about this for starters:

on *:load:/var %script = $script(0) | echo -a $script(%script)

Then I suppose you could do a:

Code:
on *:load: {
  var %script = $script(0)
  if ($script(%script) == whatever-name) { do stuff }
}


Will that accomplish what you want on a VERY basic level?


Those who fail history are doomed to repeat it
Re: on load event #93941 13/08/04 04:14 AM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Code:
on *:load:{
  if $script(File.ini) {
    [color:red]Do something[/color]
  }
}


Edit: If you meant you wanted to check the filename of the file which the load event is being triggered in then use this:
Code:
on *:load:{
  if $script == $scriptdirFile.ini {
    [color:red]Do something[/color]
  }
}


Spelling mistakes, grammatical errors, and stupid comments are intentional.