mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 133
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jan 2004
Posts: 133
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 ?

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Change $$2 to $2

Using $$* halts the script if the parameter is not present.

Joined: Jan 2003
Posts: 109
S
Vogon poet
Offline
Vogon poet
S
Joined: Jan 2003
Posts: 109
not sure, but I don't think:
/msg %we.c
is valid - should be a #channelname or $chan ?


#Newsroom
Where News & Markets Connect
http://www.inewsroom.net
Joined: Jan 2003
Posts: 109
S
Vogon poet
Offline
Vogon poet
S
Joined: Jan 2003
Posts: 109
ignore me - Iori will be right!


#Newsroom
Where News & Markets Connect
http://www.inewsroom.net
Joined: Jan 2004
Posts: 133
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jan 2004
Posts: 133

lol omg .. DOH! Thanks smile

Was driving me nuts !

Thanks Agin

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
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.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

Joined: Jan 2004
Posts: 133
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jan 2004
Posts: 133

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 ?

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard