mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 43
J
javatis Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Aug 2004
Posts: 43
hi me again....
with a lil problem again:

Code:
.set %apricot 12 $str($chr(160),7) %::idletime
if ( %apricot == 0 ) {
/msg Raffnixx %apricot gl
}
if ( %apricot < 0 ) {
/msg Raffnixx %apricot k
}
if ( %apricot > 0 ) {
/msg Raffnixx %apricot g
}


here i am checking the idle time but it in the if conditions it ever gives out

idletime k (k so its if condition idletime is kower than 0)

i think i may must convert the idletime from string to a number is that corect? and if.. how do i do this?

greetz

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
You set the variable %apricot to a string of text "12 $str($chr(160),7) %::idletime"
and then you want it to be a number??


You do not have to convert a string to a number for mIRC, but you have to make sure the string represents a number. A color code followed by a number followed by 7 strange characters (that are blank on some fonts) followed by the contents of some strangely named variable is NOT a number...

If %::idletime the the number of ms or something and that is a number, then use that:

if ( %::idletime == 0 ) {
msg Raffnixx %apricot gl
}
elseif ( %::idletime < 0 ) {
msg Raffnixx %apricot k
}
elseif ( %::idletime > 0 ) {
msg Raffnixx %apricot g
}

If there is a number somewhere in the text, and you want to check against that number, you need to extract it from that string, for example using $gettok.

Joined: Aug 2004
Posts: 43
J
javatis Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Aug 2004
Posts: 43
ok that works fine dident knew about that....

BUT on some clients i receive no idletime thatway... it just does stops working when i use that and thats what i whant to check... do you know a way that i can use to send a message when ur command up above stops the routine?

greetz


Link Copied to Clipboard