mIRC Homepage
Posted By: masterofpuppets Away system - 07/04/04 12:39 AM
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?
Posted By: landonsandor Re: Away system - 07/04/04 12:46 AM
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
Posted By: masterofpuppets Re: Away system - 07/04/04 12:50 AM
WTF?!?! Why would I need two reasons? And it still doesn't work.
Posted By: landonsandor Re: Away system - 07/04/04 12:55 AM
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.
Posted By: masterofpuppets Re: Away system - 07/04/04 12:57 AM
Well, I just tried both. Still no results!
Posted By: milosh Re: Away system - 07/04/04 01:39 AM
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.
Posted By: masterofpuppets Re: Away system - 07/04/04 01:42 AM
I mean when I press the change status on it's menu.
Posted By: milosh Re: Away system - 07/04/04 02:08 AM
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
}
Posted By: masterofpuppets Re: Away system - 07/04/04 02:16 AM
Hmm. That didnt fix it. It just won't change the status to 1.
Posted By: theRat Re: Away system - 07/04/04 06:02 AM
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
}
Posted By: masterofpuppets Re: Away system - 07/04/04 06:22 AM
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?
Posted By: MIMP Re: Away system - 07/04/04 03:27 PM
Try using: $duration(N,3) where N is your duration in seconds.
© mIRC Discussion Forums