mIRC Home    About    Download    Register    News    Help

Print Thread
Away system #78287 07/04/04 12:39 AM
Joined: Feb 2004
Posts: 33
M
masterofpuppets Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
Posts: 33
Ok, I'm trying to build a new away system for my mIRC script. And I have run into some problems here. Everytime I use the change status command on it, it just says ( ) unknown command. Here is the code.

Code:
menu status,menubar {
  Away System
  .Status ( $+ %AwayStatus $+ ) : /AwayStatus
  .Reason ( $+ %AwayReason $+ ) :/AwayReason $$?="Reason:"
}

alias AwayReason {
  set -n %AwayReason $$1
  echo **Away Reason Set
}

alias AwayStatus {
  if (%AwayStatus == 0) {
    set %AwayStatus 1
  echo **You are now set as away! }
  elseif (%AwayStatus == 1) {
    set %AwayStatus 0
  echo **You are not set as away! }
}

on *:TEXT:$me:#: {
  if (%AwayStatus == 1)  
  me is away! Reason: %AwayReason
}


WTF is wrong here?


Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!
Re: Away system #78288 07/04/04 12:46 AM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
How about using:

Code:
menu status,menubar {
  Away System
  .Status $chr(40) $+ %AwayStatus $+ $chr(41):/AwayStatus
  .Reason $chr(40) $+ %AwayReason $+ $chr(41):/AwayReason $$?="Reason:"
}


Using the following script:

Code:
menu status,menubar {
  Away System
  .Status1 $chr(40) $+ %AwayStatus $+ $chr(41):/AwayStatus
  .Reason1 $chr(40) $+ %AwayReason $+ $chr(41):/AwayReason $$?="Reason:"
}
menu status,menubar {
  Away System
  .Status2 ( $+ %AwayStatus $+ ):/AwayStatus
  .Reason2 ( $+ %AwayReason $+ ):/AwayReason $$?="Reason:"
}


I show (bad ASCII art to follow):

Away System >
Status1 ()
Reason1 ()
-----------------------
Status2 ()
Reason2 ()


----------------------- <- denotes a menu separator


So I see both of the above just fine


Those who fail history are doomed to repeat it
Re: Away system #78289 07/04/04 12:50 AM
Joined: Feb 2004
Posts: 33
M
masterofpuppets Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
Posts: 33
WTF?!?! Why would I need two reasons? And it still doesn't work.


Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!
Re: Away system #78290 07/04/04 12:55 AM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
I did it like that to test it both ways using the standard braces as well as their $chr equivalent. By doing it with both at the same time, you can check which one does NOT work easier.


Those who fail history are doomed to repeat it
Re: Away system #78291 07/04/04 12:57 AM
Joined: Feb 2004
Posts: 33
M
masterofpuppets Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
Posts: 33
Well, I just tried both. Still no results!


Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!
Re: Away system #78292 07/04/04 01:39 AM
Joined: Dec 2003
Posts: 261
M
milosh Offline
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
Quote:
Everytime I use the change status command on it

This part of your post I don't understand. What change status command? On what?
Sorry for my pure english.


velicha dusha moja Gospoda
Re: Away system #78293 07/04/04 01:42 AM
Joined: Feb 2004
Posts: 33
M
masterofpuppets Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
Posts: 33
I mean when I press the change status on it's menu.


Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!
Re: Away system #78294 07/04/04 02:08 AM
Joined: Dec 2003
Posts: 261
M
milosh Offline
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
The only thing I see wrong is this:

Code:
on *:TEXT:[color:red]*[/color]:#: {
  if [color:red]($1- == $me) &amp;&amp;[/color] (%AwayStatus == 1) me is away! Reason: %AwayReason
}

Last edited by milosh; 07/04/04 02:11 AM.

velicha dusha moja Gospoda
Re: Away system #78295 07/04/04 02:16 AM
Joined: Feb 2004
Posts: 33
M
masterofpuppets Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
Posts: 33
Hmm. That didnt fix it. It just won't change the status to 1.


Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!
Re: Away system #78296 07/04/04 06:02 AM
Joined: Dec 2002
Posts: 774
T
theRat Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
menu status,menubar {
Away System
.Status ( $+ %AwayStatus $+ ) : /AwayStatus
.Reason ( $+ %AwayReason $+ ) :/AwayReason $$?="Reason:"
}

alias AwayReason {
set -n %AwayReason $$1
echo **Away Reason Set
}

alias AwayStatus {
if (!%AwayStatus) {
set %AwayStatus 1
echo **You are now set as away! }
else {
set %AwayStatus 0
echo **You are not set as away! }
}

on *:TEXT:$($+(*,$me,*)):#: {
if (%AwayStatus)
me is away! Reason: %AwayReason
}


Code:
//if ( khaled isgod ) echo yes | else echo no
Re: Away system #78297 07/04/04 06:22 AM
Joined: Feb 2004
Posts: 33
M
masterofpuppets Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
Posts: 33
Ok, I got that working. But now I want it to show the amount of time from when i set the status to 1 and back to 0. I have tried idle but that just returns in seconds and doesn't use a hh:mm:ss style which is what i need. Can you recommend any methods of doing that?


Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!
Re: Away system #78298 07/04/04 03:27 PM
Joined: Dec 2002
Posts: 102
M
MIMP Offline
Vogon poet
Offline
Vogon poet
M
Joined: Dec 2002
Posts: 102
Try using: $duration(N,3) where N is your duration in seconds.


-
MIMP