mIRC Homepage
Posted By: WarlockW LOL .. What am I Doing Wrong ? - 30/01/04 06:03 AM
on *:TEXT:*!help*:*:{
/msg $chan 4 -= Getting help =-
set %we.num $$2
set %we.c $chan
set %we.n $nick
set %we.t $asctime(hh:nn:ss)
if (%we.num == $null) {
/msg %we.c 4 -= Sorry Cant Get Help Need Number =-
unset %we.*
halt
}
else {
/gethelp
}
}

-------------------------------------

Why Dont this give a error when a number is not given ?
Posted By: Iori Re: LOL .. What am I Doing Wrong ? - 30/01/04 06:07 AM
Change $$2 to $2

Using $$* halts the script if the parameter is not present.
Posted By: SpaceBoy Re: LOL .. What am I Doing Wrong ? - 30/01/04 06:09 AM
not sure, but I don't think:
/msg %we.c
is valid - should be a #channelname or $chan ?
Posted By: SpaceBoy Re: LOL .. What am I Doing Wrong ? - 30/01/04 06:10 AM
ignore me - Iori will be right!
Posted By: WarlockW Re: LOL .. What am I Doing Wrong ? - 30/01/04 06:39 AM

lol omg .. DOH! Thanks smile

Was driving me nuts !

Thanks Agin
Posted By: DaveC Re: LOL .. What am I Doing Wrong ? - 30/01/04 11:51 AM
Damn $$* halts the script i didnt know that i thought it halted the command it was issued on, i have just been through my scripts and weeded out 2 differnt times it would cause problems, i guess thats not so bad for about 150 $$*'s in scripts.
Stange that the help doesnt say it halts the script just says the command.
Posted By: Iori Re: LOL .. What am I Doing Wrong ? - 30/01/04 12:05 PM
Well, when I said 'script' it was in reference to that particular block of code.

mIRC will not process anything past an null valued $$identifier.

//tokenize 32 a b $false | echo -a - $$3 | echo -a hello
- $false
hello


//tokenize 32 a b $null | echo -a - $3 | echo -a hello
-
hello


//tokenize 32 a b $null | echo -a - $$3 | echo -a hello
does nothing at all.
Posted By: DaveC Re: LOL .. What am I Doing Wrong ? - 30/01/04 12:18 PM
yeah thats what i gatthered
I had previously belived it only stopped the command it was in.
Like i would have *thought* the out put of this...

alias blah {
echo Blah 1
echo Blah $$1 was passed
echo Blah 2
}

using no $1 value would have been
Blah 1
Blah 2

I did not know the whole script stops, almost every script i have where a value is missing, pretty much isnt desgned to do anything anyway so it didnt effect that much.
Posted By: WarlockW Re: LOL .. What am I Doing Wrong ? - 31/01/04 03:35 AM

How about ...

I can Save it to a txt file then do a search for line #
and out put the line # ?

Who Do I Do That ?
Posted By: Raccoon Re: LOL .. What am I Doing Wrong ? - 31/01/04 08:12 AM
Anything is possible... though we have too little to go by to tell exactly what you're doing or want.

You may find $readini and /writeini especially helpful for Help Macro type scripts.
For Example: (very basic example... add bounds checking to taste.)
Code:
on *:TEXT:*!help *:*:{
  var %keyword = $2
  var %info = $readini(help.ini,help,%keyword)
  msg $chan Help for %keyword -- %info
}

the contents of your help.ini file would look like this.
Code:
[help]
LOL       = Laughing Out Loud!
ROFL      = Rolling On the Floor, Laughing!
RTFM      = Read The Flippin` Manual!
OMGLOLBBQ = I'm Being Obnoxious Now!

The user would simply type this in the channel:

<SomDumFoo> !help ROFL

- Raccoon
© mIRC Discussion Forums