This script basicly desribes itself
Everything is on a . trigger Which i personaly enjoy.
MUST be admin to use some.
bad words used.
Rate this.
Have fun.
;Made By PyThoN
;Do not copy/crop/change
;;;;;;;;PyThoNScripTz;;;;;;;
on *:input:*: {
if ( $1 == .ban ) { /ban $chan $$2 | halt }
if ( $1 == .join ) join $$2
if ( $1 == .Green ) mode $chan +v $$2
if ( $1 == .nGreen ) mode $chan -v $$2
if ( $1 == .halfop ) mode $chan +h $$2
if ( $1 == .dehalfop ) mode $chan -h $$2
if ( $1 == .Mod ) mode $chan +o $$2
if ( $1 == .dMod ) mode $chan -o $$2
if ( $1 == .smd ) { /kick $chan $$2 }
if ( $1 == .Leave ) { /part $chan }
if ( $1 == .invite ) { /invite $$2 $chan }
if ( $1 == .Bitch ) { /kill $$2 $Chan }
if ( $1 == .Cloak ) { /hop $chan }
if ( $1 == .Kline ) { /kline $$2 $chan }
if ( $1 == .Quit ) { /quit }
}
if ($2 ison $chan) {
if ($me isop $chan) {
i would advise against these checks unless you also plan to handle the complementary cases. think about what the script is doing: if those conditions fail then the message the user typed is sent to the active window leaving the user confused and not knowing whether the script triggered or not, not to mention annoying the rest of the channel (more than usual) with unnecessary text. omitting the checks will at least result in a more informative 'you are not an operator' or 'no such nick'.
To make it better though, you need not use but # , because tells mIRC to listen to both channel and PM, and $chan is $null in PM. ( there is no $chan in PM ) So you should've used: > on *:input:#:{Then use
if ($2 ison $chan) {
without it, the $2 can be anything you wish. You can input a value
.ban aksjfhkajsdfha
and get an error. $2 ison $chan tells mIRC if $2 is a nickname on the channel where the code is run.
Finally, and this is optional, if you're not opped at all times, include
if ($me isop $chan) {
to make sure you're opped before some of these commands can be triggered, otherwise you may get an error.
Dani_11 I really Dont care if you have it as green or not.Also Copy as in Frawd It helps to think before you type.
All im looking for is comments on how this snippet could be better.
As for the changes to the script most are good but either way they both work.
No need for excess code when this works as good.
";Do not copy/crop/change"
Seriously? Are we supposed to re-type the whole thing or what? Why post it here if you cannot copy it...
Also
if ( $1 == .Green ) mode $chan +v $$2
if ( $1 == .nGreen ) mode $chan -v $$2
You do realize that not everyone, or in fact, most people do not have the colour for voices set as green?
on *:input:#:{
if ($me isop #) {
if ($2 ison #) {
goto $1
:.ban | ban # $2 2 | halt
:.smd | kick # $2 $3- | halt
:.mod | mode # +o $2 | halt
:.dmod | mode # -o $2 | halt
:.green | mode # +v $2 | halt
:.ngreen | mode # -v $2 | halt
:.halfop | mode # +h $2 | halt
:.dehalfop | mode # -h $2 | halt
}
else {
goto $1
:.bitch | kill $2 | halt
:.kline | kline $2 | halt
}
}
else {
goto $1
:.quit | quit
:.leave | part | halt
:.join | join $2 | halt
}
:error | reseterror
}
I'll use if ($me isop #) because sometimes you might forget that whether you're opped or else...before some of those commands can be initiated while being an op to do so. Of course, we can just prefix the event with @
I think $active has to be the abused identifier used by many, the second is $target
There are two conditional checks missing:
if ($me isop $chan) {
if ($2 ison $chan) {
They're beneficial to avert errors.
As an aside, there's nothing wrong with using if the way python has. What SReject has done is taking it onto another level, making it more fancier... For those who don't bother with regex may find themselves scratching their heads over it.
cough
on *:input:*: {
if ($active ischan && $me ison $active) {
if ($regex($1,/^\.(d?)(?|(v)(?:o(?:ice)?)?|(h)(?:alf)?op|(o)p)$/i)) mode $chan $iif($regml(1),-,+) $+ $regml(2) $$2
if ($1 == .ban) ban $chan $$2
if ($1 == .kick) kick $chan $$2
if ($1 == .kb) ban -ku30 $chan $$2 2 $3-
if ($1 == .part) part $chan $2-
if ($1 == .invite) invite $$2 $chan
}
if ($1 == .join) join $$2
if ($active ischan && $1 == .cycle) $iif($me ison $active,hop $2-,join $active)
if ($1 == .Quit) /quit $1-
}
.v - voices a user
.dv - devoices a user
.h - halfops a user
.dh - dehalfops a user
.o - ops a user
.dh - deops a user
.Ban - bans a user
.Kick - Kicks a user
.KickBan - Kick bans a user
.Part - parts the active channel
.invite - invites a user to the active channel
.join - joins a channel
.cycle - cycles the currently active channel
.Quit - disconnects from the irc server