mIRC Home    About    Download    Register    News    Help

Print Thread
#266022 08/09/19 12:08 PM
Joined: Oct 2014
Posts: 54
O
Orobas Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Oct 2014
Posts: 54
Having a problem editing the output of a whois and whowas script currently..

It is the whowas (.lastid) i am having issues with. with the .msg #ops .. it outputs fine.. But with a large whowas.. i dont want it to flood the channel..

I have tried to swap .msg #ops to .msg $nick but no pm opens to the user issuing the command!
for the moment i have commented out the command to remove it from the ops menu of commands

Looking for a fix please.. and a limit to just 10 results being outputted. The bot is running mirc 7.55. and its unrealircd version 4.2.4.1

Code
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- | halt
  ;.msg $nick $2 $+ 's whowas ID: $+($3,@,$4) and Real Name was: $6- | halt
}
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)) {
    tokenize 32 $regml(2) | whowas $2
  }
}

Joined: Nov 2017
Posts: 19
G
Pikka bird
Offline
Pikka bird
G
Joined: Nov 2017
Posts: 19
You can specify the maximum count in the whowas command, eg. /whowas goblin58 10

Joined: Oct 2014
Posts: 54
O
Orobas Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Oct 2014
Posts: 54
cry oh man...... ended up going hashtables and everthing plus having to halt raw312 .... script is fixed and running now though thanks to Degausser. This is what we ended up with

Code
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-
  if ($hasActiveSearch(314,$2)) {
    haltdef
    sendToUser $numeric $2 10 $2 $+ 's whowas ID: $+($3,@,$4) and Real Name was: $6-
  }
}

raw 406:*: {
  if ($hasActiveSearch(314,$2)) {
    haltdef
    sendToUser 314 $2 $2 $+ 's whowas information could not be found
  }
}

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

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
    if (!$hasActiveSearch(314,$2)) tokenize 32 $regml(2) | whowas $2
  }
}

;/addRawUser [rawEventId] [searchTerm/searchForUser] [searchByUser]
alias -l addRawUser {
  var %search = $2, %user = $3, %table = $+(event_search_table_,$1), %table2 = event_search_max
  if (!$hget(%table)) .hmake %table 2
  if (!$hget(%table2)) .hmake %table2 2
  if ($len($hget(%table,%search))) hadd %table %search $addtok($hget(%table,%search),%user,9)
  else hadd %table %search %user
  if (!$hget(%table2,$+($1,_,$2))) hadd event_search_max $+($1,_,$2) 0
}

;/removeRawUser [rawEventId] [searchTerm/searchForUser]
alias -l removeRawUser {
  var %search = $2, %table = $+(event_search_table_,$1), %table2 = event_search_max
  if ($len($hget(%table,%search))) {
    hdel %table %search
    if ($len($hget(%table2,$+($1,_,%search)))) {
      hdel %table2 $+($1,_,%search)
    }
  }
}

;$hasActiveSearch([rawEventId],[searchTerm/searchForUser])
alias -l hasActiveSearch {
  return $len($hget($+(event_search_table_,$1),$2))
}

;/sendToUser [rawEventId] [searchTerm/searchForUser] [max] [message] (0 for no max)
alias -l sendToUser {
  var %search = $2, %table = $+(event_search_table_,$1)
  if ($len($hget(%table,%search))) {
    var %table2 = event_search_max, %item = $+($1,_,%search)
    if ($len($hget(%table2, %item)) && ($hget(%table2, %item) < $3 || $3 == 0)) {
      hinc %table2 %item
      if ($3 == $hget(%table2, %item)) hdel %table2 %item
      var %users = $hget(%table,%search)
      while ($len(%users)) {
        .msg $gettok(%users,1,9) $4-
        %users = $deltok(%users,1,9)
      }
    }
  }
}
raw 312:*: {
  if ($hasActiveSearch(314,$2)) haltdef
}


Link Copied to Clipboard