mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#208225 16/01/09 01:04 PM
Joined: Jan 2009
Posts: 15
I
Pikka bird
OP Offline
Pikka bird
I
Joined: Jan 2009
Posts: 15
Hello guys, I'm not sure this idea can work, but i remember some year ago a guy that show his duration away on whois, Every time when i did whois on him he showed his duration away. I've try to do it my self, it worked but not very good. I use KTE THEME i've modified the theme and add this code if (%::away) { %:echo $str($chr(160) ,14) $+(,%::c1) is away: %::away duration away: $duratie($awaytime) } that show this message 1:56p mynickname is away: away from keyboard (out to lunch) duration away: 14m but when i use another mirc for saw how look my duration away, i've see nothing message, basically message that i see first was only message for me and not for others. plus my modification showed away on every user that are away. NOW my question is can duration away see the light on whois? can this happen? please let me know. I really like to use this feature.
thank you

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
The /echo command only shows information on your screen, nothing is sent to the server for others to see. You can use /notice or /msg or /describe if you want to send information to the server.

-genius_at_work

Joined: Jan 2009
Posts: 15
I
Pikka bird
OP Offline
Pikka bird
I
Joined: Jan 2009
Posts: 15
hello genius_at_work, thank you for explain how it working.
please can you do me a little code how to describe or how to sent my away duration on the server cos haven't idea how to do.

thank you again.

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
you should be able to just replace echo with ether describe or me..

/describe bla
/me bla



if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jan 2009
Posts: 15
I
Pikka bird
OP Offline
Pikka bird
I
Joined: Jan 2009
Posts: 15
hello again, listen probably you misunderstood my question, i not want to show my duration away with /me or /describe that other on channel see it with command.
to make more simple check this image.

i want that, every time that a user did whois on me, my duration away appear on his window, so he can see me how much time i'm away, like how is on image, infact in image looks to be ok, but isn't, only work on my window, and not on other users, they can't see my duration.

please let me know. thank you again for your reply and suggestion. really appreciated from me.

Last edited by idealife; 16/01/09 04:17 PM.
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
That is a raw. I don't know which one it is.

You can use this to find out.

raw *:*:{
if (!$window(@raw)) window -e @raw
echo @raw $numeric $rawmsg
}

Then when you know the raw numeric for that line you can say.

raw <numeric>:*:{
if (duration isin $1-) { echo -a $1- }
}

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
If others shall see your current away time every time they perform a /whois on you, and as the whois information isn't sent by you but the IRC server to the person doing the whois request, the script has to update your current away reason (technically it has to send a new away reason to the network), say, every minute.

The script has either to override the default away command, or (preferrable) be triggered by different means (custom command, popups or the like). Anyway, it has to store the away reason you give, and run a timer for the time you are away (as long as you are marked away, until the "back" raw is received), which does the update thingie. Other catchwords may be "multiserver" and "resume after reconnect"...

Do you set your away manually at the moment, or do you use a script or multiple scripts to go away (some autoaway script, away/back via popups, a custom away command...)? If you already use some scripted away, pleae try to find the relevant code parts and post 'em. smile

Last edited by Horstl; 16/01/09 08:12 PM.
Joined: Jan 2009
Posts: 15
I
Pikka bird
OP Offline
Pikka bird
I
Joined: Jan 2009
Posts: 15
Really have no idea at all, for me it is impossible to do away duration on whois, the guy that i saw once who had so, maybe he was an IRCop, or a person that have access on Server, so he had access on the server to edit the raw away and make it to say like that, <user is away> <message away> and <duration away>
because otherwise is impossible, if it was so easy why others not make it before? never see twice by anyone.

i'm using a simple costumized away menu, here is the code :

&Simple Away
$iif($away,Turn Back, Go Away):if ($away) { ame is back from away duration: $duration($awaytime) | away } | else { away $$input(Enter reason,129,Set Away) | ame ladies and gentlemen! have to go now... see you soon }
.-
.$chr(160) Silent $iif($away,Back,Away):if ($away) { echo back form away } | else { away $$input(Enter reason,129,Silent Away) | echo away is set }

otherwise like how is on image, i had to change on kte theme this code and add the duration how is in red:

if (%::away) { %:echo $str($chr(160) ,14) $+(,%::c1) is away: %::away - absence: $duratie($awaytime) }

this code works, but only for me, and that has a problem, if other user are away my duration show on their away too.

probably i've asked a stupid thing that is not possibile.
anyway thank you for reply, suggestion and your time for make it possible.

Joined: Jan 2009
Posts: 15
I
Pikka bird
OP Offline
Pikka bird
I
Joined: Jan 2009
Posts: 15
DJ_Sol, you did good job to find raw number with this method, i've find it, is number 301
i tried but it does not work on your code too.
as i said, maybe is impossible to make it work.

thank you very much for your idea

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Perhaps this will do:

Code:
raw 311:*:$idle($2) | halt
alias -l idle { 
  if ($comchan($1,0)) { 
    var %c $comchan($1,0), %x, %n $1 | while (%c) { 
      %x = $addtok(%x,$duration($nick($comchan(%n,%c),%n).idle,3),32)
      dec %c 
    }
    .echo -q $nick $1 is away: duration: %x 
  }
}


Thank you, Wims.

Last edited by Tomao; 17/01/09 01:28 PM.
Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
/noop or /.echo -q should be used when you want to call a custom alias in this way, and there is an odd ",$chr(41))" in the $addtok line.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2009
Posts: 15
I
Pikka bird
OP Offline
Pikka bird
I
Joined: Jan 2009
Posts: 15
hello!
no still not working on me, just tested mirc 6.35 and message
<mynickname> is away: Working
still no duration away after my away reason

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Try this
Code:
raw 301:*:{
  if $3 {
    set $+(%,away,.,$network,.,$2) $3-
  }
}
raw 317:*:{
  if $($+(%,away,.,$network,.,$2),2) {
    echo -a $2 is away for $v1 Duration: $duration($3)
  }
  else {
    echo -a $2 is not marked as away, but has an idle time of $duration($3)
  }
}

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Question is, who's getting you right...
I assumed you want a script to have your away time shown in a whois on you, which is not related to your theme or whois reply raws (= manipulation of the local display of the data you receive from the network, but yet not manipulating the data the network keeps end sends to whoissing users - aka your actual away reason).

If I got you right, replace the code you pasted above with the following:

Code:
menu status,channel,query {
  $iif(($status == connected),&Simple Away $iif($away,[you're away]))
  .$iif(($away && %awaywithtime.msg),Turn Back $+([gone $awaywithtime.duration,]),Go Away) : { 
    $iif(($away && %awaywithtime.msg),awaywithtime.back,awaywithtime.away)
  }
  .$iif(($away && %awaywithtime.msg),Turn Back $+([gone $awaywithtime.duration,]),Go Away) Silently : { 
    $iif(($away && %awaywithtime.msg),awaywithtime.back,awaywithtime.away) silent
  }
  .-
  .$iif(($away && %awaywithtime.msg),Change Away Reason $+([,%awaywithtime.msg,])) : {
    awaywithtime.change
  }
}

raw 305:*: { awaywithtime.unset } 
on *:disconnect: { awaywithtime.unset }

; go away
alias -l awaywithtime.away {
  away $$input(Enter away reason:,qeg,$iif(($1 == silent),Silent) Set Away)
  if ($1 == silent) { echo -agc info * You're now away $+([,$!,]) } 
  else { ame ladies and gentlemen! have to go now... see you soon $+([,$!,]) }
  set -e %awaywithtime.msg $!
  set -e %awaywithtime.time $ctime
  .timer.awaywithtime 0 60 away $(%awaywithtime.msg,0) - duration: $!awaywithtime.duration
}

; go back
alias -l awaywithtime.back {
  if ($1 == silent) { echo -agc info * You're now back form away $+([,$awaymsg,]) }
  else { ame is back from away $+([,$awaymsg,]) }
  away
  awaywithtime.unset
}

; change away reason
alias -l awaywithtime.change {
  set -e %awaywithtime.msg $$input(Enter new away reason:,qeg,Change Away Reason)
  away %awaywithtime.msg - duration: $awaywithtime.duration
}

; return away time (not resetting if reason is changed via script)
alias -l awaywithtime.duration { return $duration($calc($ctime - %awaywithtime.time),2) }

; stop updating and unset stored data (manual back/script back/disconnect)
alias -l awaywithtime.unset { .timer.awaywithtime off | unset %awaywithtime.* }

__________
Edit: Note that because the "away duration" is part of the away message sent to the network itself, you'll likely have to undo the changes you made to your theme. You'll never see other user's away duration in a whois, if they don't add it to their away reason like this script does. Also note that the script above isn't cappable of multiple server connections. smile

Joined: Jan 2009
Posts: 15
I
Pikka bird
OP Offline
Pikka bird
I
Joined: Jan 2009
Posts: 15
thank you RusselB, your code work, even it says away doublicated like this:

<mynickname> is away: Working
<mynickname> is away for Working Duration: 4mins 8secs

just checked it from my mIRC, but i opened another mirc to look like it is another user, and did whois on the nick that have your code, but on window of "2nd mirc or like if it was another user" i see only <mynickname> is away: Working no duration
err frown it's impossible to see duration away from another mirc or another user.

I think dhe duration time must storage somewhere in mirc folder in a .txt, or .ini, so the code should check time every time away duration and reply when a user ask, only something like this probably can work. I'm sorry i do not want to suffer you guys, maybe i'm asking a stupid thing that isn't normal to ask.
so sorry guys, and thank you for time and code for me.

Joined: Feb 2007
Posts: 234
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
well for the duplicate problem try this:

Code:
raw 317:*:{
  if $($+(%,away,.,$network,.,$2),2) {
    echo -a $2 is away for $v1 Duration: $duration($3)
  }
  else {
    echo -a $2 is not marked as away, but has an idle time of $duration($3)
  }
  haltdef
}


the only problem with this entire 'subject' is that you cannot add this information to your whois permanently because this is simply not part of the IRC RFC.

Last edited by MTec007; 17/01/09 03:55 PM.
Joined: Jan 2009
Posts: 15
I
Pikka bird
OP Offline
Pikka bird
I
Joined: Jan 2009
Posts: 15
Horstl mate, your code work exatly. You did what i want, but i've see on status that said every minute my away status and in end i received this message on dalnet Too Many aways - Flood Protection activated looks like i'm flooding the network ?

Last edited by idealife; 17/01/09 04:01 PM.
Joined: Feb 2007
Posts: 234
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
it sounds like you have been typing /away too much. does that sound correct to you ?

Joined: Jan 2009
Posts: 15
I
Pikka bird
OP Offline
Pikka bird
I
Joined: Jan 2009
Posts: 15
no i'm not typing away to much, just did one time only, but i see every minute on status this message You have been marked as being away even i not writte /away

maybe the code of Horstl, that work good check every minute server and in 4min after 4 message of You have been marked as being away in the end i got Too Many aways - Flood Protection activated from network

Last edited by idealife; 17/01/09 04:11 PM.
Joined: Feb 2007
Posts: 234
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
can you copy all your code for this script here, something is not working right

Page 1 of 2 1 2

Link Copied to Clipboard