mIRC Home    About    Download    Register    News    Help

Print Thread
LOL .. What am I Doing Wrong ? #69687 30/01/04 06:03 AM
Joined: Jan 2004
Posts: 133
W
WarlockW Offline OP
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 ?

Re: LOL .. What am I Doing Wrong ? #69688 30/01/04 06:07 AM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
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.

Re: LOL .. What am I Doing Wrong ? #69689 30/01/04 06:09 AM
Joined: Jan 2003
Posts: 109
S
SpaceBoy Offline
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
Re: LOL .. What am I Doing Wrong ? #69690 30/01/04 06:10 AM
Joined: Jan 2003
Posts: 109
S
SpaceBoy Offline
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
Re: LOL .. What am I Doing Wrong ? #69691 30/01/04 06:39 AM
Joined: Jan 2004
Posts: 133
W
WarlockW Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Jan 2004
Posts: 133

lol omg .. DOH! Thanks smile

Was driving me nuts !

Thanks Agin

Re: LOL .. What am I Doing Wrong ? #69692 30/01/04 11:51 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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.

Re: LOL .. What am I Doing Wrong ? #69693 30/01/04 12:05 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
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.

Re: LOL .. What am I Doing Wrong ? #69694 30/01/04 12:18 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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.

Re: LOL .. What am I Doing Wrong ? #69695 31/01/04 03:35 AM
Joined: Jan 2004
Posts: 133
W
WarlockW Offline OP
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 ?

Re: LOL .. What am I Doing Wrong ? #69696 31/01/04 08:12 AM
Joined: Feb 2003
Posts: 2,711
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,711
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!