mIRC Home    About    Download    Register    News    Help

Print Thread
#221613 25/05/10 05:27 PM
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
After updating to 7.03 from 6.35 this script stop working. The part where it sets you away works, but it has stopped setting you back. Anyone know why? Worked like a dream in 6.35.

Code:
away.system.auto {
  if %away.system == off && %away.system.auto == on && $server != $null {
    set -u %autoaw 1 | set -u %aw | set -u %naw | scon -at1 aw
    if (!$away) && (%autoaw) && (!%aw) && %away.system.auto.status == off {
      scon -at1 away %away.system.auto.message
      echo.mode You have been automatically marked as being away after $duration(%away.system.auto.check,2) of idle
      titlebar - [Auto Away $duration(%away.system.auto.check,2) $+ ]
      set %away.system.auto.status on
    }
    if (!%autoaw) && (%aw) && %away.system.auto.status == on {
      scon -at1 away
      echo.mode Away has automatically been turned off
      titlebar
      set %away.system.auto.status off
    }
  }
}

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
I remember I helped you with this, but you still didn't use what I gave you, there's no way this script work on 6.35 and not on 7.03.
I guess the problem is that you're not using the same mirc.ini file, so different configuration.

You didn't show the 'aw' alias, which is needed here.

Anyways, the scon command is changing the active connection so when you check if (!$away), you're checking this on the last connected server, probably not what you want.

Show here the 'aw' alias and explain very clearly what you want if you want more help


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
Code:
aw {
  if ($idle < %away.system.auto.check) { set -k %autoaw 0 | if ($away) set -k %aw 1 | else set -k %naw 1 }
  if ($idle > %away.system.auto.check) { set -k %autoaw 1 | if ($away) set -k %aw 0 | else set -k %naw 0 }
}


Way it worked before.

Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
if condition { }
else { }

try to replace the second if by elseif

Code:
elseif (!%autoaw) && (%aw) && %away.system.auto.status == on {


WorldDMT
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
still no.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
http://kthx.net/ftb

Read the guide and find out how to narrow down your script and find the exact line that is failing or behaving differently in 7.x. Then you can ask why that line is behaving differently (if you still don't know)


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Dec 2002
Posts: 5,412
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,412
While this could be a bug, it is more likely to be an issue with your script. The only way to be sure is to use debugging in your script. For example, you can use debugging in this way:

Code:
away.system.auto {
  echo away.system : %away.system
  echo away.system.auto : %away.system.auto
  echo server : $server
  if %away.system == off && %away.system.auto == on && $server != $null {

You should add similar lines before every %variable and $identifier that is used in the script. This will allow you to see at which point the script is not working. If you then run the same script, in the same situation, under both v6.35 and v7.x, you can compare the output to see whether the debug values are different.


Link Copied to Clipboard