mIRC Homepage
Posted By: Deep3D Script stop working in 7.03 - 25/05/10 05:27 PM
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
    }
  }
}
Posted By: Wims Re: Script stop working in 7.03 - 25/05/10 07:44 PM
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
Posted By: Deep3D Re: Script stop working in 7.03 - 27/05/10 05:48 AM
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.
Posted By: chacha Re: Script stop working in 7.03 - 27/05/10 12:35 PM
if condition { }
else { }

try to replace the second if by elseif

Code:
elseif (!%autoaw) && (%aw) && %away.system.auto.status == on {
Posted By: Deep3D Re: Script stop working in 7.03 - 31/05/10 03:36 AM
still no.
Posted By: argv0 Re: Script stop working in 7.03 - 31/05/10 03:50 AM
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)
Posted By: Khaled Re: Script stop working in 7.03 - 31/05/10 10:20 AM
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.
© mIRC Discussion Forums