Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;# #
- ;# IdealIRC Essentials script #
- ;# #
- ;# Defines menus and shortened commands. #
- ;# Also provides as an example to #
- ;# how a script is set up. #
- ;# #
- script Essentials {
- command j join
- command p part
- command ns nickserv
- command cs chanserv
- command cycle cycle
- event IALHostGet GotHostname
- }
- menu status {
- Server info {
- Server stats = server_stats
- Server info = info
- Server links = links
- Server map = map
- sep
- Server time = time
- sep
- Show Server Admin = admin
- sep
- Server version = version
- Unrealircd Credits = credits
- }
- sep
- List All Channels = list
- sep
- List All Users = who
- sep
- Join channel... = join_channel
- Change nickname... = change_nickname
- sep
- Quit = quit
- }
- menu query {
- Whois = query_whois
- sep
- CTCP {
- Ping = CTCP_ping
- Time = CTCP_time
- Version = CTCP_version
- }
- }
- menu channel {
- Channel settings = chan_settings
- Channel Modes {
- List Current Modes = modes
- sep
- Moderated (+m) {
- ON = modeon
- OFF = modeoff
- }
- Strip Colors (+c) {
- ON = coloron
- OFF = coloroff
- }
- CTCP control (+C) {
- ON = ctcpon
- OFF = ctcpoff
- }
- sep
- Chanserv Help = cshelp
- sep
- }
- sep
- List All Channels = list
- sep
- List All Users = who
- sep
- Server info {
- Server stats = server_stats
- Server info = info
- Server links = links
- Server map = map
- sep
- Server time = time
- sep
- Show Server Admin = admin
- sep
- Server version = version
- Unrealircd Credits = credits
- }
- sep
- Cycle Channel = cycle
- }
- menu nicklist {
- Query = query
- Whois = whois
- sep
- CTCP {
- Ping = CTCP_ping
- Time = CTCP_time
- Version = CTCP_version
- }
- sep
- Operator {
- Give op = give_op
- Take op = take_op
- Give voice = give_voice
- Take voice = take_voice
- sep
- Kick = kick
- Kick, ban = kickban
- }
- }
- ;$ Custom commands /j and /p /ns and /cs:
- function join(%c, %k) {
- if ($len(%k) > 0) {
- join #%c %k
- }
- else {
- join #%c
- }
- }
- function part(%c, %r) {
- if ($len(%c) == 0) {
- part $target
- return
- }
- if ($sstr(%c, 0, 1) != #) {
- part $target %c %r
- return
- }
- part %c %r
- }
- function nickserv(%c, %k) {
- if ($len(%k) > 0) {
- nickserv %c %k
- }
- else {
- nickserv %c
- }
- }
- function chanserv(%c, %k) {
- if ($len(%k) > 0) {
- chanserv %c %k
- }
- else {
- chanserv %c
- }
- }
- ;$ Menu in status window:
- function server_stats() {
- lusers
- }
- function join_channel() {
- var %c $input(Join a channel, Enter a channel name:)
- if ($button == Cancel) {
- return
- }
- if ($sstr(%c, 0, 1) != #) {
- join #%c
- return
- }
- join %c
- del %c
- }
- function change_nickname() {
- var %n $input(Change nickname, Enter a new nickname:)
- if ($button == Cancel) {
- return
- }
- nick %n
- del %n
- }
- ;$ Menu in query window:
- function query_whois(%n) {
- whois %n
- }
- ;$ Menu in channel textbox
- function chan_settings(%c) {
- chansettings
- }
- ;$ Menu in channel listbox:
- function query(...) {
- if (%1 == $NULL) {
- return
- }
- query %1
- }
- function whois(...) {
- if (%1 == $NULL) {
- return
- }
- whois %1
- }
- function give_op(...) {
- if (%1 == $NULL) {
- return
- }
- var %len $token(%0, 0, 32)
- if (%len == 0) {
- return
- }
- var %i 1
- while (%i <= %len) {
- var %letter $glue(%letter,o)
- var %nick $glue(%nick, $char(32), %+%i)
- inc %i
- }
- mode $target +%letter%%nick%
- del %letter
- del %nick
- }
- function take_op(...) {
- if (%1 == $NULL) {
- return
- }
- var %len $token(%0, 0, 32)
- if (%len == 0) {
- return
- }
- var %i 1
- while (%i <= %len) {
- var %letter $glue(%letter,o)
- var %nick $glue(%nick, $char(32), %+%i)
- inc %i
- }
- mode $target -%letter%%nick%
- del %letter
- del %nick
- }
- function give_voice(...) {
- if (%1 == $NULL) {
- return
- }
- var %len $token(%0, 0, 32)
- if (%len == 0) {
- return
- }
- var %i 1
- while (%i <= %len) {
- var %letter $glue(%letter,v)
- var %nick $glue(%nick, $char(32), %+%i)
- inc %i
- }
- mode $target +%letter%%nick%
- del %letter
- del %nick
- }
- function take_voice(...) {
- if (%1 == $NULL) {
- return
- }
- var %len $token(%0, 0, 32)
- if (%len == 0) {
- return
- }
- var %i 1
- while (%i <= %len) {
- var %letter $glue(%letter,v)
- var %nick $glue(%nick, $char(32), %+%i)
- inc %i
- }
- mode $target -%letter%%nick%
- del %letter
- del %nick
- }
- function kick(...) {
- if (%1 == $NULL) {
- return
- }
- var %reason $input(Kick reason, Enter a kick reason:)
- if ($button == Cancel) {
- return
- }
- kick %1 %reason
- }
- function kickban(...) {
- if (%1 == $NULL) {
- return
- }
- var %reason $input(Kick reason, Enter a kick reason:)
- if ($button == Cancel) {
- return
- }
- if ($IALHostMask(%1) == $NULL) {
- var %ban %1
- userhost %1
- return
- }
- mode $target +b $IALHostMask(%1)
- kick %1 %reason
- }
- ;$ CTCP menu
- function CTCP_ping(...) {
- if (%1 == $NULL) {
- return
- }
- ctcp %1 ping
- }
- function CTCP_time(...) {
- if (%1 == $NULL) {
- return
- }
- ctcp %1 time
- }
- function CTCP_version(...) {
- if (%1 == $NULL) {
- return
- }
- ctcp %1 version
- }
- ;$ Utilities...
- function GotHostname(%nickname, %hostmask) {
- if (%ban == %nickname) {
- mode $target +b %hostmask
- kick %nickname %reason
- del %ban %reason
- }
- }
- ;$ ********* ADDONS *********
- function cycle(%c) {
- part %c
- join %c
- }
- function info() {
- info
- }
- function admin() {
- admin
- }
- function credits() {
- credits
- }
- function links() {
- links
- }
- function list() {
- list
- }
- function map() {
- map
- }
- function module() {
- module
- }
- function motd() {
- motd
- }
- function names() {
- names
- }
- function quit(...) {
- var %reason $input(Quit, Enter a quit reason:)
- if ($button == Cancel) {
- return
- }
- if ($sstr(%reason, 0, 1) != #) {
- quit %reason
- return
- }
- quit %reason
- del %reason
- }
- function time() {
- time
- }
- function version() {
- version
- }
- function who() {
- who
- }
- ;$ channel modes
- function modes(%c) {
- mode %c
- }
- function modeon(%c) {
- mode %c +m
- }
- function modeoff(%c) {
- mode %c -m
- }
- function coloron(%c) {
- mode %c +c
- }
- function coloroff(%c) {
- mode %c -c
- }
- function ctcpon(%c) {
- mode %c +C
- }
- function ctcpoff(%c) {
- mode %c -C
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement