mIRC Homepage
Posted By: Kurdish_Assass1n /idle on several users - 08/05/06 10:50 PM
Code:
 menu nicklist {
  Notify: {
    var %x = 1, %notice = $?="Notice with?"
    while (%x <= $snick($active,0)) {
      .notice $snick($active,%x) %notice
      inc %x
    }
  }
}
 


Basically what this does above ^^
I want to highlight a lot of users, and click on "idle" and be able to show all of them, please, you guys are a LOT of help, lol, thanks again.
Posted By: MikeChat Re: /idle on several users - 08/05/06 10:58 PM
.Notice $1 idle #:notice $1 idle time in # $duration($nick(#,$1).idle)

thats a line from popups for nicklist

see if you can pick up what you can do with that
Posted By: Kurdish_Assass1n Re: /idle on several users - 08/05/06 11:02 PM
no, what I mean, is I want it to echo everyone's idle time:

Example:
× Idle Time for Kurdish_Assass1n: 9mins 3secs
Posted By: MikeChat Re: /idle on several users - 08/05/06 11:07 PM
that is what I was saying, but whatever

sample
Code:
alias idlers {
  var %idlenicks = $snicks
  var %i = 1
  var %nicktoken = $gettok(%idlenicks,0,44)
  while (%i <= %nicktoken) {
    var %checknick = $gettok(%idlenicks,%i,44)
    notice %checknick Your Idle Time in $active $+ : $duration($nick($active,%checknick).idle)
    inc %i
  }
}


CAUTION: Flooding will result if you do a lot of nicks at once.
Posted By: Kurdish_Assass1n Re: /idle on several users - 09/05/06 01:58 AM
MkeChat, thanks a lot, that works good, but, it notices the nicks, sorry if that's what you thought I said:
I just want it to do this:
if I select the following nicks:
Kurdish_Assass1n
XBC-BOT
Mafia
---
and then I click on "idle Time" it'll echo this:
× Idle Time for Kurdish_Assass1n: 3mins 57secs
× Idle Time for XBC-BOT: 39mins 5secs
× Idle Time for Mafia: 20hrs 34mins 21secs
and, not for the channel only, for all of the server, if this is possible, please help.
Posted By: MikeChat Re: /idle on several users - 09/05/06 02:27 AM
1) If you cant figure that out on your own, maybe scripting isnt for you.

2) Server wide can't be done like this, unless you are in the channel with them. If you are a Server Administrator, or an IRCop then you need to learn how to work with that software to get what you want. If you are not Admin or IRCop then you shouldn't be worried about who is idle on the server.
Posted By: Kurdish_Assass1n Re: /idle on several users - 09/05/06 02:37 AM
ok ok, i'm sorry, nevermind, thanks though. just heard it's not a good idea to use that script.
Posted By: MikeChat Re: /idle on several users - 09/05/06 03:05 AM
Quote:
just heard it's not a good idea to use that script.


Im not sure what you mean here... could you explain that?
Posted By: SladeKraven Re: /idle on several users - 09/05/06 03:07 AM
Performing several whoises I guess.
Posted By: MikeChat Re: /idle on several users - 09/05/06 03:11 AM
Andy, it doesn't use whois
Posted By: SladeKraven Re: /idle on several users - 09/05/06 03:19 AM
He told me he wanted everyones idle from whois, or atleast thats what it sounded like to me.
Posted By: MikeChat Re: /idle on several users - 09/05/06 04:14 AM
Quote:
He told me he wanted everyones idle from whois, or atleast thats what it sounded like to me.


I dont see that in this thread anywhere, so I take it you sent him a message. Certainly a loop with a whois for every nick on a server or network is going to flood you off with only a few nicks.

In what I posted all he had to do would be to change the notice to an echo and it would do what he originally asked for.

If you think that doing a whois on all users on a server/network is the way to go, I hope for the OP's sake its a small server/network.
Posted By: Kurdish_Assass1n Re: /idle on several users - 09/05/06 03:50 PM
Code:
alias idlers {  
  var %idlenicks = $snicks
  var %i = 1  
  var %nicktoken = [color:blue]$gettok(%idlenicks,0,44)[/color]
  while (%i <= %nicktoken) {  
    var %checknick = [color:blue]$gettok(%idlenicks,%i,44)[/color]
    notice %checknick Your Idle Time in $active $+ : $duration($nick($active,%checknick).idle)  
    inc %i 
 }}

I understand most of this, i'm just trying to learn how to use these type of scripts. I colored the parts I don't understand, please explain them and how they work, thanks, and honestly, i'm not a bad scripter, just don't know how to use these type of scripts, but, know how to use dialogs and other scripts. thanks
Posted By: RedDevilUK Re: /idle on several users - 09/05/06 04:04 PM
Code:
 
alias idlers {  
  var %idlenicks = $snicks
  var %i = 1  
  var %nicktoken = $gettok(%idlenicks,0,44)
  while (%i <= %nicktoken) {  
    var %checknick = $gettok(%idlenicks,%i,44)
    notice %checknick Your Idle Time in $active $+ : $duration($nick($active,%checknick).idle)  
    inc %i 
 }
}
 


the last brackets need moving like here, otherwise you will receive the error
* /while: close bracket not found

cheers
Posted By: RedDevilUK Re: /idle on several users - 09/05/06 04:25 PM
Code:
Idlers
.Notice Idler {  
  var %idlenicks = $snicks
  var %i = 1  
  var %nicktoken = $gettok(%idlenicks,0,44)
  while (%i <= %nicktoken) {  
    var %checknick = $gettok(%idlenicks,%i,44)
    notice %checknick Your Idle Time in $active $+ : $duration($nick($active,%checknick).idle)  
    inc %i 
  }
}
.Notice me {  
  var %idlenicks = $snicks
  var %i = 1  
  var %nicktoken = $gettok(%idlenicks,0,44)
  while (%i <= %nicktoken) {  
    var %checknick = $gettok(%idlenicks,%i,44)
    notice $me %checknick = Idle Time in $active $+ : $duration($nick($active,%checknick).idle)  
    inc %i 
  }
}
.Show Channel {  
  var %idlenicks = $snicks
  var %i = 1  
  var %nicktoken = $gettok(%idlenicks,0,44)
  while (%i <= %nicktoken) {  
    var %checknick = $gettok(%idlenicks,%i,44)
    say %checknick Your Idle Time in $active $+ : $duration($nick($active,%checknick).idle)  
    inc %i 
  }
}

.Window list {  
  if (!$window(@idlers)) window @idlers  
  var %idlenicks = $snicks
  var %i = 1  
  var %nicktoken = $gettok(%idlenicks,0,44)
  while (%i <= %nicktoken) {  
    var %checknick = $gettok(%idlenicks,%i,44)
    aline @idlers [[ $fulldate ]] %checknick = Idle Time in $active $+ : $duration($nick($active,%checknick).idle)
    inc %i 
  }
}
 


now you can
notice the user his idle time
send Notice to yourself
Send results to the channel
open another window and list them (flood safe if doing many)

cheers
would that be the Kurdish Assasin from Xbox Connect by the way smile

edited and bracket removed
Posted By: MikeChat Re: /idle on several users - 09/05/06 04:42 PM
Quote:
Code:
alias idlers {  
  var %idlenicks = $snicks
  var %i = 1  
  var %nicktoken = [color:blue]$gettok(%idlenicks,0,44)[/color]
  while (%i <= %nicktoken) {  
    var %checknick = [color:blue]$gettok(%idlenicks,%i,44)[/color]
    notice %checknick Your Idle Time in $active $+ : $duration($nick($active,%checknick).idle)  
    inc %i 
 }
}

I understand most of this, i'm just trying to learn how to use these type of scripts. I colored the parts I don't understand, please explain them and how they work, thanks, and honestly, i'm not a bad scripter, just don't know how to use these type of scripts, but, know how to use dialogs and other scripts. thanks

I don't see how "scripting dialogs" is any different
--------------------------------------------------------------
why didn't you type /help $gettok

in the help file:
$gettok(text,N,C)
Returns the Nth token in text.

$gettok(a.b.c.d.e,3,46) returns c
$gettok(a.b.c.d.e,9,46) returns $null

You can also specify a range of tokens:

$gettok(a.b.c.d.e,2-,46) returns 2nd token onwards b.c.d.e
$gettok(a.b.c.d.e,2-4,46) returns tokens 2 through 4 b.c.d

You can specify a negative value for N.

$gettok(string,0,44) in this case will return the number of nicks you selected, see the help for $numtok as it replaces this

$numtok(text,C)
Returns number of tokens in text.
------------------------------------------

$snicks returns a list of selected nicks delimited by commas
nick1,nick2,nick3

$gettok allows you to select one of the nicks based on its position in the string
$gettok(nick1,nick2,nick3,2,44) would return nick2

using the while loop you can then check each nickname one at a time for the idle time with the %i increasing each time through the loop
$gettok(%idlenicks,%i,44)

notice %checknick Your Idle Time in $active $+ : $duration($nick($active,%checknick).idle)
change that to
echo -a %checknick $+ `s Idle Time in $active $+ : $duration($nick($active,%checknick).idle)

and then you will see it echoed, not notice the info to the nick
Posted By: bwr30060 Re: /idle on several users - 09/05/06 04:44 PM
Nice script. I do have one problem when I run that though. If I choose "Window list", I get this:
[ Tue May 09 12:42:01 2006 ] Blake = Idle Time in @idlers:

Looks pretty good otherwise.
Posted By: RedDevilUK Re: /idle on several users - 09/05/06 05:06 PM
whoops

its me thats messed up with brackets now smile

remove the extra close bracket } at the end

it works to the window if you do one user at a time??

but not if you choose many

wierd
Posted By: MikeChat Re: /idle on several users - 09/05/06 05:10 PM
Quote:
Nice script. I do have one problem when I run that though. If I choose "Window list", I get this:
[ Tue May 09 12:42:01 2006 ] Blake = Idle Time in @idlers:

Looks pretty good otherwise.


It's what I wrote with minor changes, and the notice me is a bad way to do that, why send the data to the server if you are having the server send it back to you, using echo -a doesn't send the data to the server to be sent back to you.

Also he didn't change the $active when he changed it to post to the @window, since that window became the active window its trying to get an idle time for the custom window.

repaired
Code:
menu nicklist {
  Idlers
  .Notice Idler {  
    var %idlenicks = $snicks
    var %i = 1  
    var %nicktoken = $gettok(%idlenicks,0,44)
    while (%i <= %nicktoken) {  
      var %checknick = $gettok(%idlenicks,%i,44)
      notice %checknick Your Idle Time in $active $+ : $duration($nick($active,%checknick).idle)  
      inc %i 
    }
  }
  .Echo {  
    var %idlenicks = $snicks
    var %i = 1  
    var %nicktoken = $gettok(%idlenicks,0,44)
    while (%i <= %nicktoken) {  
      var %checknick = $gettok(%idlenicks,%i,44)
      echo 3 -a %checknick $+ 's Idle Time in $active $+ : $duration($nick($active,%checknick).idle)  
      inc %i 
    }
  }
  .Show Channel {  
    var %idlenicks = $snicks
    var %i = 1  
    var %nicktoken = $gettok(%idlenicks,0,44)
    while (%i <= %nicktoken) {  
      var %checknick = $gettok(%idlenicks,%i,44)
      say %checknick Your Idle Time in $active $+ : $duration($nick($active,%checknick).idle)  
      inc %i 
    }
  }
  .Window list {  
    if (!$window(@idlers)) window @idlers  
    var %idlenicks = $snicks
    var %i = 1  
    var %nicktoken = $gettok(%idlenicks,0,44)
    while (%i <= %nicktoken) {  
      var %checknick = $gettok(%idlenicks,%i,44)
      aline @idlers $+($chr(91),$fulldate,$chr(93)) %checknick $+ 's Idle Time in # $+ :  $duration($nick(#,%checknick).idle)
      inc %i 
    }
  }
}


this is set to be used in remotes, remove the menu { and the last } to use in the popup.ini for the nicklist.
Posted By: RedDevilUK Re: /idle on several users - 09/05/06 05:16 PM
this is the problem
active $+ : $duration

the gap is too wide
active $+ : $duration

that fixes it

above scripts now edited too... should work fine now

yes its basically your script with bells on smile
cheers for the foundation...
and i agree with the echo statement smile
Posted By: Kurdish_Assass1n Re: /idle on several users - 09/05/06 07:45 PM
Quote:

cheers
would that be the Kurdish Assasin from Xbox Connect by the way smile

yes grin
© mIRC Discussion Forums