mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
This is my Away System.

If I am connected on 2 networks, one where my nick is Nick_1 and the other where my nick is Nick_2.

When I go away (/away.system), nicks change to Nick_1\aw and Nick_2\aw on the two different networks. So far everything is OK.

But when I return with /away.system.back my nicks change to either Nick_1 or Nick_2 (it depends witch network I am displaying).

And thats the problem. How to get my script to return to the correct nick for both networks?

Code:
away.system {
  if (!$1-) echo.grey You need to set an away reason
  else {
    set %away.system on
    set %_away 1
    set %_away.reason $1-
    set %_away.oldnick $me
    set %_away.time $ctime
    $iif(%away.multi == on,scon -at1) away %_away.reason
    if (%away.nick.change == on) $iif(%away.multi == on,scon -atl) away.system.nick
    if (%away.public == on) $iif(%away.multi == on,scon -atl) ame $+(is away: %_away.reason)
    if %away.public == on { echo.grey You have been marked as being away, press F3 to get back! }
    else { 
      echo.grey You have been marked as being away: %_away.reason $+ , press F3 to get back!
      if %away.nick == $null { echo.grey Note: Awaynick is not set, using $me $+ \aw as norm }
    }
    titlebar - The Reactor Script - Away: %_away.reason
  }
}

away.system.nick {
  if %away.nick == $null { tnick $me $+ \aw }
  else { tnick %away.nick } 
}

away.system.away {
  if %away.system == on { echo.grey You are already away: %_away.reason $+ , press F3 to get back! }
  else { away.system $$?="Away System:" }
}

away.system.update.away {
  if %away.system == off { echo.grey You are not away! }
  else {
    set %_away.reason $$?="Update Away Message:"
    scon -at1 away $!
    titlebar - The Reactor Script - Away: %_away.reason
    echo.grey Udated away to: %_away.reason $+ , press F3 to get back!
  }
}

away.system.back {
  if (!%_away) echo.grey You are not away!
  else {
    if (%away.nick.change == on) $iif(%away.multi == on,scon -at1) nick %_away.oldnick
    if (%away.public == on) $iif(%away.multi == on,scon -at1) ame $+(is back from: %_away.reason (awaytime: $duration($calc($ctime - %_away.time),2),)) $+ )
    $iif(%away.multi == on,scon -at1) away
    if %away.public == on { echo.grey Away turned off }
    else { echo.grey Away turned off, back from: %_away.reason (awaytime: $duration($calc($ctime - %_away.time),2) $+ ) }
    titlebar - The Reactor Script
    set %away.system off
    unset %_away*
  }
}

Last edited by Deep3D; 23/01/08 12:00 AM.
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
A guy at #scripting at Quakenet made this for me.

But I wan't to se how the above script works with /scon. Please help me. Thanks

Code:
alias away.system {
  if (!$1) {
    if (!%_away) { echo.grey You need to set an away reason | return }
    scon -at1 away.back
    titlebar - The Reactor Script
    echo.grey Away turned off, back from: %_away.reason (awaytime: $duration($calc($ctime - %_away.time),2) $+ )
    unset %_away*
  }
  else {
    if (%_away.reason) {
      echo.grey Udated away to: $1- $+ , press F3 to get back!
      scon -at1 away.upd $1-
    }
    else {
      set %_away.time $ctime
      scon -at1 away.set $1-
      echo.grey You have been marked as being away: $1- $+ , press F3 to get back!
    }
    set %_away 1
    set %_away.reason $1-
    titlebar - The Reactor Script - Away: $1-
  }
}
 
alias -l away.set {
  set %_away.oldnick. $+ $cid $me
  if (%away.public == on) { ame is away: $1- }
  if (!%away.nick) { tnick $me $+ \aw }
  else { tnick %away.nick }
  away $1-
}
 
alias -l away.upd { away $1- }
 
alias -l away.back {
  if (%_away.oldnick. [ $+ [ $cid ] ]) { tnick $v1 }
  away
  ame is back from: %_away.reason (awaytime: $duration($calc($ctime - %_away.time),2) $+ )
}

Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
For your original 1.

Try changing.

set %_away.oldnick $me

To.

/scon -a if ($status == connected) set %_away.oldnick $!me

The ! is necessary.

Now of course, the above won't work since you're defining the same variable twice.

So you will need to make a variable for every network you're connected on.

So maybe something like.

/scon -a if ($status == connected) set %_away.oldnick $+ $cid $!me

Or something.

I'm at school, so I haven't looked over or tested.


Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
/scon -a if ($status == connected) set %_away.oldnick $+ $cid $!me
Error: * /set: invalid parameters

And how will the code be for the /away.system.back be?

Thanks for your help! smile

Joined: Dec 2002
Posts: 2,033
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,033

Originally Posted By: Deep3D

Error: * /set: invalid parameters


%!_away.oldnick

or

scon -a if ($status == connected) set $!+(%,_away.oldnick.,$cid) $!me

Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
Thank you! It works perfect. Now, only one more thing.

How to get /away.system.back to get the right variable for the diffrent networks?

Code:
if (%away.nick.change == on) $iif(%away.multi == on,scon -at1) nick %away.oldnick. $+ $cid


The above code is incorrect. frown

Thanks for your help and support people.

Joined: Dec 2002
Posts: 2,033
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,033

See if this works..
Code:

if (%away.nick.change == on) {
  if (%away.multi == on) scon -at1 nick $!eval($+(%,_away.oldnick.,$cid),2)
  else nick $eval($+(%,_away.oldnick.,$cid),2)
}



~ Edit ~

Fixed both $eval's ... sorry.


Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
This really helped me! Thanks mate! smile


Link Copied to Clipboard