|
|
#1 (permalink) |
|
AdMiN oF RoCk!
Join Date: Mar 2003
Location: uk
Posts: 2,080
|
Useful Scripts Thread
Use This Thread To Share scripts you have written/found.
if you found a good script on the web, post the link (credit where credit is due ect) and if you use a script from this thread, please keep the details of the originator in the script, its considered polite. when posting a script you wrote, please also post a set of instructions on whats needed to load and use the script, in order to make it accessable to everyone, no matter the level of scripting knowlage.( from NONE to err McGreff )here is an example script to start the thread off, it had a few changes made to the original by Mcgreff, so i added my own credit, this in irc scripting terms is classed as 'acceptable use' unless otherwise stated by the creator. ------------------------------------------ Code:
;Nicksaver script version 2
;written for use on irc.p2pchat.net
;this script is designed to prevent you losing your nick
;in the event of a netsplit or disconnection
;if it detects your nick changed to p2p4567767
;it waits 60 seconds then changes your nick
;and reidentifys you using the nick/pass set in the script
;it also tracks nick changes, so if you swap between nicks
; in your group and disconnect, it will change your nick back
;and issue the set group password to identify you
;change 'nickname' to your own nickname
;change 'password' to your password in the line below
;original script written by McGreff of #pctechtalk.com
;testing final adjustments and introduction/credits
;by RipperRoo of #pctechtalk.com
var %mypass
var %mynick
on:load: {
set %myNick nickname
set %mypass password
}
on 1:nick: {
; revert back the preferred nick if revoked by nickserv
if ($nick == %myNick && $left($newnick, 3) == p2p) {
/timer 1 66 nick %myNick
/timer 1 68 msg nickserv identify %mypass
/timer 1 70 amsg 6I'm using 'Nicksaver' get it from:
/timer 1 71 amsg 12http://www.pctechtalk.com/
}
; track the nick change otherwise
else if ($nick == %myNick) {
set %myNick $newnick
}
}
__________________
PcTechtalk.com Admin A7V8X xp2600 Barton SLK 97U, GeForce FX 5700, 1GB 2700DDR Ram Sony DVD -R/+R/RW, SB Live 5.1 Digital, 1 x 30gb 3 x 200GB 2x120GB 1 x 250GB HDD'S, 19" TFT Epson R265 HP NX6125 Laptop 1gb memory http://www.minotaur-computers.co.uk/ |
|
|
|
|
|
#2 (permalink) |
|
AdMiN oF RoCk!
Join Date: Mar 2003
Location: uk
Posts: 2,080
|
and here is the zip.
unzip to your script folder then follow these brief instructions, as you need to set your nick and pass within the script its best to load it via the script editor, on your mirc client go to 'Tools' 'Script Editor' (ALT+R is the shortcut) - go to the remote tab, click 'File' then 'Load' and find load the script called 'nicksaver-V2.mrc' once loaded change the nickname and password as instructed within the script and away you go
__________________
PcTechtalk.com Admin A7V8X xp2600 Barton SLK 97U, GeForce FX 5700, 1GB 2700DDR Ram Sony DVD -R/+R/RW, SB Live 5.1 Digital, 1 x 30gb 3 x 200GB 2x120GB 1 x 250GB HDD'S, 19" TFT Epson R265 HP NX6125 Laptop 1gb memory http://www.minotaur-computers.co.uk/ |
|
|
|
|
|
#3 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
A little piece of code from RaDiOBoT:
Code:
; automatic voicing system:
; the radiobot automatically voices users not op or hop
; because the chanbot is slower than radiobot, we have to wait a little before
; checking if a person should be voiced or not
on 1:join:#pctechtalk.com: ./timer 1 2 /voiceuser $nick $chan $gettok($chan(#pctechtalk.com).mode,1,32)
alias voiceuser {
if (m !isin $3) {
if ($1 !isop $2 && $1 !ishop $2) {
mode $2 +v $1
}
}
}
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
#4 (permalink) |
|
Lurking AdMiN
Join Date: Mar 2003
Location: In my own little world. Buts its ok. They know me here.
Posts: 3,245
|
Nothing special here.. just a little diddy to make things easier for you. This script will identify your registered nickname and then join any number of channels you specify. Saves me time every day since I hang out in about 10 channels.
![]() Code:
/p2p {
/msg nickserv identify password
/j #pctechtalk.com
/j #channel
/j #channel
/j #channel
/j #channel
/j #channel
/j #channel
/j #channel
}
Enjoy
__________________
Vote For Us! -- It will get you hot chicks. No really It will! ---- www.myTego.com - Give your devices a face! Dont be a conformist! |
|
|
|
|
|
#5 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
Hey, want it to connect and join automagically? Put it in remotes:
Code:
on 1:connect: {
nick mynick
msg nickserv identify password
join #1
join #2
...
}
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
#6 (permalink) |
|
Registered User
Join Date: Oct 2003
Location: UK
Posts: 6
|
Here is a "Mass Voicer" which could be found useful
Code:
on *:TEXT:!massvoice Channel:#: massvoice $chan
alias massvoice {
if ( $1 == $null || $me !isop # || $nick !isop # ) { halt }
set %mvoice1 1
set %mvoice2 2
set %mvoice3 3
:loop
mode $1 +vvvvvv $nick($1,%mvoice1,a,voh) $nick($1,%mvoice2,a,voh) $nick($1,%mvoice3,a,voh)
if $nick($1,%mvoice1,a,voh) == $null goto end
inc %mvoice1 3
inc %mvoice2 3
inc %mvoice3 3
goto loop
:end
unset %mvoice1
unset %mvoice2
unset %mvoice3
}
*EDIT as this is a loop that can have any number of %mvoice variables, its been cut down from 6 to three in order to save the frames, the unaltered script can be found HERE or attached to the thread below as a zipped .mrc file RipperRoo Last edited by Mick; 11-12-2003 at 02:21 PM. |
|
|
|
|
|
#7 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
Hmmm... why 6 at once? Is that for performance reasons? I would have done it with a while-loop construct... What's the idea behind this one?
B.T.W. TOOO bad for the design here, I need to be able to read the code here.
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
#8 (permalink) | ||
|
Registered User
Join Date: Oct 2003
Location: UK
Posts: 6
|
Quote:
Quote:
I would appreciate seeing what you would have used, instead of the one i made, thanks in advance Last edited by Mick; 11-12-2003 at 02:41 PM. |
||
|
|
|
|
|
#9 (permalink) |
|
AdMiN oF RoCk!
Join Date: Mar 2003
Location: uk
Posts: 2,080
|
Mick's massvoice script (zipped) saved as an .mrc file
(the full 6 at once version)
__________________
PcTechtalk.com Admin A7V8X xp2600 Barton SLK 97U, GeForce FX 5700, 1GB 2700DDR Ram Sony DVD -R/+R/RW, SB Live 5.1 Digital, 1 x 30gb 3 x 200GB 2x120GB 1 x 250GB HDD'S, 19" TFT Epson R265 HP NX6125 Laptop 1gb memory http://www.minotaur-computers.co.uk/ |
|
|
|
|
|
#10 (permalink) | |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
Quote:
Code:
on 1:text:!massvoice *:*: {
; find out if we have a chan to voice,
; if we are op and the user issuing the command is op too.
; If not, stop the script...
if ($2 == $null || $me !isop $2 || $nick !isop $2) {
msg $chan Either you ( $+ $nick $+ ) or me ain't op in $2
halt
}
; iterate through all members in the chan
var %i
set %i 1
; we request only users which have no state (yet)
while ($nick($2, %i, a, voh)) {
mode $2 +v $nick($2, %i, a, voh)
set %i $calc(%i + 1)
}
}
I added this command to RaDiOBoT, thanks Mick!
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
|
#11 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
Ok, Dunce tempted me to improve this little script, here the results:
Code:
on 1:text:!massvoice:*: {
; find out if we are op and the user issuing the command is op too.
; If not, stop the script...
if ($me !isop $chan || $nick !isop $chan) {
msg $chan Either you ( $+ $nick $+ ) or me ain't op in $chan
halt
}
; iterate through all members in the chan
var %i, %voicestr
set %i 1
; we request only users which have no state (yet)
while ($nick($chan, %i, a, voh)) {
set %voicestr v $+ %voicestr $nick($chan, %i, a, voh)
set %i $calc(%i + 1)
}
mode $chan + $+ %voicestr
}
on 1:text:!massdevoice:*: {
; find out if we are op and the user issuing the command is op too.
; If not, stop the script...
if ($me !isop $chan || $nick !isop $chan) {
msg $chan Either you ( $+ $nick $+ ) or me ain't op in $chan
halt
}
; iterate through all members in the chan
var %i, %voicestr
set %i 1
; we request only users which have state v
while ($nick($chan, %i, v)) {
set %voicestr v $+ %voicestr $nick($chan, %i, v)
set %i $calc(%i + 1)
}
mode $chan - $+ %voicestr
}
It also operates on the channel it is called in, for I saw no issue in giving the channel to operate on.
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
#13 (permalink) |
|
Registered User
Join Date: Oct 2003
Location: UK
Posts: 6
|
Just an observation:
Your use of on 1:text:!massvoice:*: would indicate usage in other forms other than just text in channel: Agreed? ie: in a notice perhaps.... yet both returns are in $chan output would it be wise to use on 1:text:!massvoice:#: or use on 1:text:!massvoice *:*: and change all $chan to $1 which will enable the trigger "!massvoice #channame" in any format I take it this would work: please advise |
|
|
|
|
|
#14 (permalink) | |
|
AdMiN oF RoCk!
Join Date: Mar 2003
Location: uk
Posts: 2,080
|
Quote:
using $1 would make the channrl name '!massvoice', you would need to use $2 to pick up the second word. also using it this way with 'on 1:text:!massvoice *:*: ' would enable the op of one channel your bot is in to send the command to any other, so it would need to be locked down to either an access list or a control channel. heres is an exaple of an access list script from radiobot; the 1st section adds a nick to the text file used, notice the initial usernick is hardcoded into the script to prevent unautherised aditions, once people are added, because of the way the script is written, they can add others to the list: Code:
on 1:text:!addaccess *:*: {
if ($read(conf/access.txt, s, $nick) == true || $nick == McGreff) {
write conf/access.txt $2 true
}
}
next the alias that is used in commands that querys the text file: Code:
alias isAccess {
if ($read(conf/access.txt, s, $1) == true) {
return true
}
else {
return $null
}
}
and finaly an example of its use: Code:
on 1:text:radiobot do you need a reboot:#: {
if ($isAccess($nick)) {
msg $chan 6Yes Please $nick
}
}
the above code (taken from radiobot) was written by McGreff ![]() some command triggers have been renamed to preserve the security of RaDiOBoT
__________________
PcTechtalk.com Admin A7V8X xp2600 Barton SLK 97U, GeForce FX 5700, 1GB 2700DDR Ram Sony DVD -R/+R/RW, SB Live 5.1 Digital, 1 x 30gb 3 x 200GB 2x120GB 1 x 250GB HDD'S, 19" TFT Epson R265 HP NX6125 Laptop 1gb memory http://www.minotaur-computers.co.uk/ |
|
|
|
|
|
|
#15 (permalink) | ||||
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
Quote:
Quote:
You please tell me, I might have some work to do afterwards Quote:
Quote:
RaDiOBoT in fact only controls #pctechtalk.com, therefore it's useless for me to have to type !massvoice #pctechtalk.com if I'm in #pctechtalk.com. I just require you to be in the channel you want to mass(de)voice. And to prevent misuse I also require you to have yourself the permissions to do it.
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
||||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|