Skip to content
Chatcore Network

Remote Commands Security: Check If Nick Is Authorized User

A TG007 community discussion started by Travis.

Discussion 3 posts
Page 1 of 1
Open
Topic #14907 · 3 published posts · 1,426 views

I wrote this script so you can add someone to a user group by their nickname and be able to make sure they are registered. This way, if the person is gone and someone clones the nick, your text commands won't trigger since the nick isn't logged in.

 

The user level in this example is 10. You can make this 'admin' or whatever you like. Just make sure you replace every occurrence of '10' with your user group name. Optionally you can remove this and use $user or $level to support more than one group.

 

alias cc_isreg return $iif($readini(nexus.ini,ccore_reg,$1),1,0)
on 10:join:#:{
  if (%join10 [ $+ [ $nick ] ] > 3) return
  inc -u5 %join10 [ $+ [ $nick ] ]
  whois $nick
}
raw 307:*:{
  if (!%join10 [ $+ [ $2 ] ]) return
  writeini neXus.ini ccore_reg $2 1
}
on 10:part:#:{
  if ($readini(nexus.ini,ccore_reg,$nick)) remini nexus.ini ccore_reg $nick
}
on 10:quit:{
  if ($readini(nexus.ini,ccore_reg,$2)) remini nexus.ini ccore_reg $2
}

/*
Example:

menu nicklist {
Add Level 10:auser 10 $$1
}

on 10:text:*:#:{

if (!$cc_isreg($nick)) return

tokenize 32 $regsubex($1-, /^##\*.*\*##/,$null)
if ($1 = .hop) hop #

}
*/

nice there is also a new snippet area available you can submit snippets to . It has a chatcore category

 

http://www.tg007.net/page/snippet&cat=5

Get information about ircWx here

Chatcore changed to IRCx. This code was written for the old UnrealIRCd.