mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
/idle on several users #148621 08/05/06 10:50 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
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.


-Kurdish_Assass1n
Re: /idle on several users #148622 08/05/06 10:58 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
.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

Re: /idle on several users #148623 08/05/06 11:02 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
no, what I mean, is I want it to echo everyone's idle time:

Example:
Idle Time for Kurdish_Assass1n: 9mins 3secs


-Kurdish_Assass1n
Re: /idle on several users #148624 08/05/06 11:07 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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.

Re: /idle on several users #148625 09/05/06 01:58 AM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
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.


-Kurdish_Assass1n
Re: /idle on several users #148626 09/05/06 02:27 AM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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.

Re: /idle on several users #148627 09/05/06 02:37 AM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ok ok, i'm sorry, nevermind, thanks though. just heard it's not a good idea to use that script.


-Kurdish_Assass1n
Re: /idle on several users #148628 09/05/06 03:05 AM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Quote:
just heard it's not a good idea to use that script.


Im not sure what you mean here... could you explain that?

Re: /idle on several users #148629 09/05/06 03:07 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Performing several whoises I guess.

Re: /idle on several users #148630 09/05/06 03:11 AM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Andy, it doesn't use whois

Re: /idle on several users #148631 09/05/06 03:19 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
He told me he wanted everyones idle from whois, or atleast thats what it sounded like to me.

Re: /idle on several users #148632 09/05/06 04:14 AM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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.

Re: /idle on several users #148633 09/05/06 03:50 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
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


-Kurdish_Assass1n
Re: /idle on several users #148634 09/05/06 04:04 PM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline
Ameglian cow
Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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

Re: /idle on several users #148635 09/05/06 04:25 PM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline
Ameglian cow
Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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

Last edited by RedDevilUK; 09/05/06 05:18 PM.
Re: /idle on several users #148636 09/05/06 04:42 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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

Re: /idle on several users #148637 09/05/06 04:44 PM
Joined: May 2005
Posts: 449
bwr30060 Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
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.

Re: /idle on several users #148638 09/05/06 05:06 PM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline
Ameglian cow
Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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

Last edited by RedDevilUK; 09/05/06 05:12 PM.
Re: /idle on several users #148639 09/05/06 05:10 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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.

Last edited by MikeChat; 09/05/06 05:25 PM.
Re: /idle on several users #148640 09/05/06 05:16 PM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline
Ameglian cow
Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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

Page 1 of 2 1 2