mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2013
Posts: 1
S
Mostly harmless
OP Offline
Mostly harmless
S
Joined: Dec 2013
Posts: 1
Hey Everyone!!

I've written a mIRC script so that a bot will sit in a room and run executable files when asked. One of those .exe files will move files from one directory to another, but its very important for my users to specify the first four characters (always digits) of the file, or the .exe will move ALL files from the source directory to the destination directory.

The section of code my bot uses for this looks like this--

Code:
  :pull
  if (%enabled = 1) {
    run "C:\BOT\pull.exe" $$2
    notice $nick PULL $$2
  }
  else {
    notice $nick I've not been enabled.
  }
  return


Is there any way for me to include:
If $$2 does not = 4 digits, notice $nick Which file?

I'm pretty sure my logic is right.. but I cant get the syntax down for what I'm trying to make the bot do..

any help is greatly appreciated!!

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
You've asked for two different things so:

Begins with:
Code:
if (!$regex($$2,^\d\d\d\d)) { notice ... }


Is entirely:
Code:
if (!$regex($$2,^\d\d\d\d$)) { notice ... }

Joined: Dec 2011
Posts: 18
J
Pikka bird
Offline
Pikka bird
J
Joined: Dec 2011
Posts: 18
You could also use:

if (%enable == 1) && ($left($$2,4) isnum) {
....
}


Link Copied to Clipboard