Degausser commented on a Page, Oper who/whowas limit fix needed  -  Sep 15, 2019

Yeah I had trouble responding a couple days ago, but figured I'd make the fix publicly available. The issue was that $nick wasn't referencing what you expected. This was my solution:

Edited about an hour after original post with new link: https://pastebin.com/bAw6cA0j - This should go through all returned results.

Cheiron  -  Sep 15, 2019

Missed a few bits of code there.. but i fixed that bit.. however..
still errors.. the bot outputs everything to status still... but it does open the pm now.. but,... it only shows 1 result on the whowas! dont forget when you post a code to use square brackets with code and /code inside them.. [ code ] code here [ /code ] obviosly without the spaces in the square brackets :)

raw 311:*: {
  .msg #ops $2 $+ 's whois ID: $+($3,@,$4) and Real Name is: $6- | halt
}
raw 314:*: {
  ;.msg #ops $2 $+ 's whowas ID: $+($3,@,$4) and Real Name was: $6-
  sendToUser $numeric $2 $2 $+ 's whowas ID: $+($3,@,$4) and Real Name was: $6-
  haltdef
}

on *:text:*:#ops: {
  if ($nick isop $chan) && ($regex($1-,/(^|\s)(.idshow?w?s?\s\S+)/i)) {
    tokenize 32 $regml(2) | whois $2
  }
  if ($nick isop $chan) && ($regex($1-,/(^|\s)(.lastid?d?s?\s\S+)/i)) {
    addRawUser 314 $2 $nick
    tokenize 32 $regml(2) | whowas $2
  }
}

;/addRawUser <searchTerm/searchForUser>
alias -l addRawUser {
  var %search = $2, %user = $3, %table = $+(event_searchtable,$1)
  if (!$hget(%table)) .hmake %table 2
  if ($len($hget(%table,%search))) hadd %table %search $addtok($hget(%table,%search),%user,9)
  else hadd %table %search %user
}

;/sendToUser <searchTerm/searchForUser>
alias -l sendToUser {
  var %search = $2, %table = $+(event_searchtable,$1)
  if ($len($hget(%table,%search))) {
    var %users = $hget(%table,%search)
    while ($len(%users)) {
      .msg $gettok(%users,1,9) $3-
      %users = $deltok(%users,1,9)
    }
    hdel %table %search
  }
}
Degausser  -  Sep 15, 2019

I've used a link in my previous post to format the script output properly

Cheiron  -  Sep 15, 2019

That outputed some 30+ whowas's! not 10 heh.... it showed the whole lot. gone from 1 to all!

Degausser  -  Sep 16, 2019

Alright, edited the link once more, it should now limit to 10. I can't test because event 311 never gets called on the network I reside on, it always falls to 314. Hopefully you'll be able to sniff out any bugs that pop up, if indeed there are any.

Cheiron  -  Sep 16, 2019

Yeap thats working perfect to pm Degausser.. awesome work and many thanks. Just a curiousity... but is there a way to stop the scroll in the bot's status when it calls the whowas?

Degausser  -  Sep 16, 2019

Yeah but I can't reproduce the output, so here's what you should do.. Add this to your remotes:

raw *:*:{ echo -s $numeric $+ : $1- }

Then check all numbers that popup in the status window when someone triggers lastid. If the user exists, you will see 314, 369, and maybe something else? So that other number you see (not 406, this is user not found), take it and replace the number 9999 below with that number:

raw 9999:*: {
  if ($hasActiveSearch(314,$2)) haltdef
}

And maybe that does the trick? Otherwise I don't really know what you mean... I don't really see a reason why any form of auto-scrolling / output would be displayed.

Don't forget to remove the first piece of code from your script afterwards.

Cheiron  -  Sep 16, 2019

the raw is 312. nice catch and fix. i take my hat off to you. much appreciated

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.