mIRC Home    About    Download    Register    News    Help

Print Thread
#99856 06/10/04 04:10 PM
Joined: Jun 2003
Posts: 92
K
k1ll3rz Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2003
Posts: 92
can someone help me make an autoaway script where it sets me away after so many seconds.... if im away and i say something it makes me come back from away but if im not away and i type something i want it to start a timer so after say 300 seconds it sets me away. ALSO when i use the away system i created and i type: //echo $away it returns false even though i am set as away.... any help would be appreciiated.... thanx k1ll3rz


k1ll3rz
#99857 06/10/04 04:17 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
well, as a VERY generic (basic) start for you:

on *:input:*:/.timerAWAY 1 300 /away Auto-idle Away

or

on *:input:*:/.timerAWAY 1 300 /awayalias

Code:
/awayalias {
  away Auto-idle Away
  command1
  command2
  etc
  etc
  etc
}


Now granted this could likely cause HIGH cpu usage as everytime you type something and send it the timer'll restart. Also, it might help if you showed us the away system you're using so that we might be able to help you further


Those who fail history are doomed to repeat it
#99858 06/10/04 05:12 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Frankly, there would be much CPU power needed for that. Starting a timer isn't something you can even notice, being the mere human that one is. and since it's not starting a new one, but restarting an existing one, you won't get your RAM clogged up with timers either.

As for the $away: the moment you hit the ENTER key, your $away is reset. So it's normal that mIRC then displays the value 0.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#99859 07/10/04 04:11 AM
Joined: Jun 2003
Posts: 92
K
k1ll3rz Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2003
Posts: 92
;Away
dialog away {
title "Away System"
size -1 -1 109 67
option dbu
text "Reason", 1, 0 0 27 8, center
edit "", 2, 0 11 50 10, autohs autovs return
text "Nick", 3, 58 0 17 8, center
edit "", 4, 59 11 50 10, autohs autovs return
button "Away", 5, 18 23 32 12
button "Back", 6, 59 23 32 12
text "Logger", 7, 0 37 25 8, center
radio "On", 8, 0 49 19 8
radio "Off", 9, 0 58 20 8
text "Autoaway", 10, 44 46 34 8, center
edit "", 11, 73 55 30 10, autohs multi return
text "Minute(s)", 12, 45 56 26 8, center
}
alias away {
if (!$dialog(away)) {
dialog -dm away away
}
elseif ($dialog(away)) {
echo -a $timestampz $box(Away Dialog Already Open)
}
}
on *:dialog:away:sclick:8: {
set %away.msglogger on
}
on *:dialog:away:sclick:9: {
set %away.msglogger off
}
on *:dialog:away:sclick:5: {
if ($did(11) != $null) {
set %away.minutes $did(11)
}
set %away.nick $did(4)
if ($did(4) != $null) {
.tnick %away.nick
}
set %away true
set %away.reason $did(2)
set %away.leftat $asctime(h:nn:sstt)
scon -atl ame $box(is Away) $box(Reason: %away.reason $+ ) $box(Left At: %away.leftat $+ )
.timeraway 0 3600 scon -atl ame $box(is Away) $box(Reason: %away.reason $+ ) $box(Left At: %away.leftat $+ )
}
on *:dialog:away:sclick:6: {
.nick $readini mirc.ini mirc nick
set %away.returnat $asctime(h:nn:sstt)
set %away false
scon -atl ame $box(is Back) $box(Reason: %away.reason $+ ) $box(Left At: %away.leftat $+ ) $box(Returned At: %away.returnat $+ )
.timeraway off
}
on *:dialog:away:close:*: {
unset %away.*
}

on 1:TEXT:*:?: {
if (%away.msglogger == on) {
window -kt @Logged_Messages
echo @Logged_Messages $timestampz $box( $+ $nick said: $1- $+ )
write Remotes\LoggedMessages.txt $strip( $+ $timestampz $box( $+ $nick said: $1- $+ ) $+ )
close -m $nick
}
}




away sytem i am using that i created.... thanx for helping with the autoaway if you can


k1ll3rz
#99860 07/10/04 09:48 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Your script never sets /away, which is why $away is always $false.
Code:
on *:dialog:away:sclick:5: {
  if ($did(11) != $null) {
    set %away.minutes $did(11) 
  }
  set %away.nick $did(4)
  if ($did(4) != $null) { [color:green]tnick $v1[/color] }
  set %away true
  set %away.reason $$did(2)
  set %away.leftat $asctime(h:nn:sstt)
  scon -atl ame $box(is Away) $box(Reason: %away.reason $+ ) $box(Left At: %away.leftat $+ )
  .timeraway 0 3600 scon -atl ame $box(is Away) $box(Reason: %away.reason $+ ) $box(Left At: %away.leftat $+ )
  [color:blue]away $did(2)[/color]
}
on *:dialog:away:sclick:6: {
  [color:green]nick $mnick[/color]
  set %away.returnat $asctime(h:nn:sstt)
  set %away false
  scon -atl ame $box(is Back) $box(Reason: %away.reason $+ ) $box(Left At: %away.leftat $+ ) $box(Returned At: %away.returnat $+ )
  .timeraway off
  [color:blue]away[/color]
}




Link Copied to Clipboard