Simple Service Script

Release your script here.
State:
- Author
- What it does
- Perhaps a little guide.
- Also, if the snippet is of any use to the community, it has a chance of getting posted on the main page, so don't hesitate to submit/ask!

Simple Service Script

Postby Zodac0de » Tue May 12, 2009 6:38 pm

Hello sp00fed!

Here's a little service script.

How to use:
You need to change channel, and trigger.
SETTRIGGERHERE
You must set trigger before using script.

Exemple:
set %trigger §


(20:32:53) (@Ahlkvist) §trigger -
(20:32:54)  -› [notice from [Fyk]]: Your trigger is now: -

(20:33:15) (@Ahlkvist) §mytrigger
(20:33:16)  -› [notice from [Fyk]]: Your trigger is: -

As you see, you can change the trigger, but if you forget it, or want to change it you need the § (SETTRIGGERHERE)

All commands can be found with command help (Remember to use trigger first.)

Code: Select all
;# Find me at #zodac0de @ qnet if you need help or got ideas for my scripts.
;# Script by zodac0de
;# Version: 1.0

on *:TEXT:*:#CHANNEL: {
  if ($nick isop $chan) {
    if ($me isop $chan) {
      set %trigger [ $+ [ $nick ] ] SETTRIGGERHERE
      if ($1 == %trigg [ $+ [ $nick ] ] $+ op) { mode $chan +o $2 }
      if ($1 == %trigg [ $+ [ $nick ] ] $+ deop) { mode $chan -o $2 }
      if ($1 == %trigg [ $+ [ $nick ] ] $+ kick) { kick $2 $3- }
      if ($1 == %trigg [ $+ [ $nick ] ] $+ invite) { invite $2 $chan }
      if ($1 == %trigg [ $+ [ $nick ] ] $+ voice) { mode $chan +v $2 }
      if ($1 == %trigg [ $+ [ $nick ] ] $+ devoice) { mode $chan -v $2 }
      if ($1 == %trigg [ $+ [ $nick ] ] $+ bc) { amsg (@Broadcast) $2- (Powered by #we.are.oldschool) }
      if ($1 == %trigg [ $+ [ $nick ] ] $+ j) { join $2 }
      if ($1 == %trigg [ $+ [ $nick ] ] $+ p) { part $2 }
      if ($1 == %trigg [ $+ [ $nick ] ] $+ say) { msg $chan $2- }
      if ($1 == %trigger [ $+ [ $nick ] ] $+ trigger) { set %trigg [ $+ [ $nick ] ] $2 | notice $nick Your trigger is now: %trigg [ $+ [ $nick ] ] }
      if ($1 == %trigger [ $+ [ $nick ] ] $+ mytrigger) { notice $nick Your trigger is: %trigg [ $+ [ $nick ] ] }
      if ($1 == %trigg [ $+ [ $nick ] ] $+ help) {
        notice $nick Commands:
        notice $nick Op: %trigg [ $+ [ $nick ] ] $+ op <nick> - use to @/op someone.
        notice $nick Deop: %trigg [ $+ [ $nick ] ] $+ deop <nick> - use to -@/deop someone.
        notice $nick Kick: %trigg [ $+ [ $nick ] ] $+ kick <nick> <reason> - use to kick someone from channel.
        notice $nick Invite: %trigg [ $+ [ $nick ] ] $+ invite <nick> - use to invite someone to channel.
        notice $nick Voice: %trigg [ $+ [ $nick ] ] $+ voice <nick> - use to +/voice someone.
        notice $nick Devoice: %trigg [ $+ [ $nick ] ] $+ devoice <nick> - use to -/devoice someone.
        notice $nick Broadcast: %trigg [ $+ [ $nick ] ] $+ bc <message> - use to broadcast all channels.
        notice $nick Join: %trigg [ $+ [ $nick ] ] $+ j #<channel> - use to join channel.
        notice $nick Part: %trigg [ $+ [ $nick ] ] $+ p #<channel> - use to part channel.
        notice $nick Say: %trigg [ $+ [ $nick ] ] $+ say <text> - use to say anything in channel.
        notice $nick Change trigger: %trigger [ $+ [ $nick ] ] $+ trigger <symbol> - use to change your trigger.
        notice $nick Trigger: %trigger [ $+ [ $nick ] ] $+ mytrigger - If you forget your trigger, use this.
      }
      if ($1 == %trigg [ $+ [ $nick ] ] $+ version) { notice $nick Simple Sevice Script
        notice $nick Scripter: zodac0de
        notice $nick Version: 1.0
      }
    }
    else { notice $nick I'm not @/op in $chan }
  }
  else { notice $nick You don't have access to this command. }
}
Last edited by Zodac0de on Tue May 12, 2009 7:47 pm, edited 2 times in total.
Zodac0de
 

Re: Simple Service Script

Postby zNigel- » Tue May 12, 2009 6:57 pm

You can also change the %trigger to something like %trigger. $+ $nick . Else it will be a global trigger.
zNigel-
 

Re: Simple Service Script

Postby Zodac0de » Tue May 12, 2009 7:29 pm

zNigel wrote:You can also change the %trigger to something like %trigger. $+ $nick . Else it will be a global trigger.

Thanks, (lol) forgot it xD
Zodac0de
 

Re: Simple Service Script

Postby zNigel- » Tue May 12, 2009 7:32 pm

No worries.. Just an idea :)
zNigel-
 

Re: Simple Service Script

Postby Blady » Tue May 12, 2009 7:39 pm

You can also change :

if ($1 == %trigg $+ op) (and all 'test' line) to recognize on <trigger>command and <botnick> command

Do something like :

Code: Select all
on @*:TEXT:*:#CHANNEL: {
  if ($nick isop $chan) {
    set %trigger SETTRIGGERHERE

    if ($1 == $me) { var %cmd = $2 }
    elseif ($left($1,1) == %trigger) { var %cmd = $right($1,-1) }
    else halt

    if (%cmd == op) { mode $chan +o $2 }
    if (%cmd == deop) { mode $chan -o $2 }

(and so on...)

  }
}

Blady
 

Re: Simple Service Script

Postby Zodac0de » Tue May 12, 2009 7:43 pm

hm :idea: :arrow:
Last edited by Zodac0de on Sun May 24, 2009 10:46 pm, edited 1 time in total.
Zodac0de
 

Re: Simple Service Script

Postby Zodac0de » Sat May 16, 2009 7:46 am

Blady wrote:You can also change :

if ($1 == %trigg $+ op) (and all 'test' line) to recognize on <trigger>command and <botnick> command

Do something like :

Code: Select all
on @*:TEXT:*:#CHANNEL: {
  if ($nick isop $chan) {
    set %trigger SETTRIGGERHERE

    if ($1 == $me) { var %cmd = $2 }
    elseif ($left($1,1) == %trigger) { var %cmd = $right($1,-1) }
    else halt

    if (%cmd == op) { mode $chan +o $2 }
    if (%cmd == deop) { mode $chan -o $2 }

(and so on...)

  }
}



Thanks againg!
I read it thrue again, and now i get it.
So soon (when im at home and have time) I'll update it!

// zodac0de!
Zodac0de
 

Re: Simple Service Script

Postby StareX » Tue Jun 02, 2009 6:03 am

I must say it but I say it..

This is a nice script that would be great :)
StareX
 

Re: Simple Service Script

Postby Zodac0de » Tue Jul 21, 2009 2:08 am

StareX wrote:I must say it but I say it..

This is a nice script that would be great :)



Thanks, but it will take a while... :(

Not that "hot" to make it "better" more "advanced" =)
Zodac0de
 

Re: Simple Service Script

Postby Zodac0de » Tue Jul 21, 2009 2:42 am

Blady wrote:You can also change :

if ($1 == %trigg $+ op) (and all 'test' line) to recognize on <trigger>command and <botnick> command

Do something like :

Code: Select all
on @*:TEXT:*:#CHANNEL: {
  if ($nick isop $chan) {
    set %trigger SETTRIGGERHERE

    if ($1 == $me) { var %cmd = $2 }
    elseif ($left($1,1) == %trigger) { var %cmd = $right($1,-1) }
    else halt

    if (%cmd == op) { mode $chan +o $2 }
    if (%cmd == deop) { mode $chan -o $2 }

(and so on...)

  }
}




I thought about it once more. you cant make
if ($1 == $me) { var %cmd = $2 }
elseif ($left($1,1) == %trigger) { var %cmd = $right($1,-1) }
else halt

if (%cmd == op) { mode $chan +o $2 }
if (%cmd == deop) { mode $chan -o $2


if you set if ($1 == $me) { var %cmd = $2 } and you write:
<botnick> op Nick
The nick will be the $3 so the if (%cmd == op) { mode $chan +o $2 } wont work. Cuz $2 were the command and nick were $3 :O

Hope you understand :P If you know how to solve this, please reply! =)
Zodac0de
 

Next

Return to Mirc Scripting Release

Who is online

Users browsing this forum: No registered users and 2 guests

cron