Adblock breaks this site

Intro to IRC Scripting

Discussion in 'Archives' started by Sacro, Dec 15, 2008.

  1. Sacro

    Sacro Gunny - 168gr SMK Shooter
    $5 USD Donor Retired Sectional Moderator

    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    This is a very basic intro to IRC scripting. I personally have created scripts over 10,000 lines of text. This is a small dose to possibly show people their next hobby. The 3 major parts of IRC scripting are:

    Aliases
    Popups
    Remotes




    Aliases:
    Aliases are, in my oppinion, the easiest/best way learn IRC scripting. They can save alot of time when you need it. Let's start with something simple. For example, those who use SytheIRC and register, will be messaged every login to identify themselves as the owner of the nickname being used, to avoid typing a line of text every time you sign on, you can do a script. This will not only save time, but will conceal your password. Open up your aliases by clicking Tools->Script Editor->Then the "alias" tab. Put this on a open line of text.

    /id /msg nickserv identify PASSWORD
    }

    The first word on a line in aliases is always treated as a new command. Anything after that is what the command does. So, /id is the new command, and /msg nickserv identify YourPassword is what it does. Followed by a "}" to end that script.

    Popups:
    Popup menu definitions use the format menu item:commands, so Help Me!:/join #help would take you to #help the same as if you had typed /join #help. To start a menu, put whatever you want the menu to say at the top of the page. This is the easiest, you can rearrange it later as you please. To create a submenu, use a "." fullstop. To make more submenus, use "..", "...", etc. In my oppinion this is a waste of time, but i feel it needed anyway.


    Remotes:
    I think remotes are the most useful, and can be the most complicated scripts used on IRC. But this doesnt mean that all of them are hard.

    Remote Script's just mean that they use triggers to run the script, this means that unlike Alias's, you can use multiple triggers, Ban, Join, Part, Text, Input, Highlight etc.

    First lets try a simple onjoin message.

    on *:JOIN:#mychan:/msg $chan Hi $nick $+ , welcome to $chan $+
    }

    Now on a join to your channel, your bot will message them a greeting of "Hi whoever, welcome to #mychan"


    *Note* This is a very Generic Join script



    IDENTIFIERS:

    A identifier is something that identifies a variable in a script. Here are some common ones:

    $me - used when you want the bot to do something to itself
    $nick - $nick is whoever triggered script.
    $chan - channel in which script was triggered
    $2, $3,- second, third, etc word in command (ex. !kick loser scans for a $2, find that $2 = loser, and kicks it)
    $null - when referring to a variable that doesn't exist
    $$? - used in popups to create options

    This is only a beginner guide, if you would like to learn more about scripting, feel free to message me on ZypurIRC, and SytheIRC. (Irc.zypur.com and Irc.sythe.org)
     
  2. Pshynosis

    Pshynosis POLIISI
    Do Not Trade

    Joined:
    Nov 4, 2005
    Posts:
    2,160
    Referrals:
    1
    Sythe Gold:
    0
    Intro to IRC Scripting

    ...Into mIRC scripting ._.
     
  3. Giddy

    Giddy Legend
    Prince Yobabo Retired Global Moderator

    Joined:
    May 23, 2006
    Posts:
    11,746
    Referrals:
    9
    Sythe Gold:
    0
    born 2late 2 explore the earth b0rn 2soon 2 explore the galaxy born just in time 2 browse sith d0t org Oktoberfest 2013 The Mortyest Morty Pokémon Trainer Heidy (2) St. Patrick's Day 2014 Lawrence Christmas 2015 Christmas 2013
    Halloween 2015 Two Factor Authentication User Spam Forum Participant
    Intro to IRC Scripting

    Nice guide, I'm glad you posted one.
    Sacro knows his stuff.
     
  4. Dustein

    Dustein Guest

    Referrals:
    0
    Intro to IRC Scripting

    Good guide, but a couple of things...

    I don't see the point of the bracket at the end of your scripts. If you check it, you get a bracket mismatch.

    To clarify $me, $me identifies whatever nickname you are using at the moment. Do //echo $me and it should return your current nickname.

    And you forgot $1 and $<number>-
     
  5. Sacro

    Sacro Gunny - 168gr SMK Shooter
    $5 USD Donor Retired Sectional Moderator

    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    Dustein, the brackets in script's, part them for future ones. Ex.
    off *:INVITE:#: {
    if ($chan(0) >= 30) {
    notice $nick $c2($nick,I am currently full, please try again later.)
    halt
    }
    if ($readini(botinfo.ini,n,kicks,$chan) < 5) || ($readini(botinfo.ini,n,kicks,$chan) == $null) {
    msg #rawr $+($chr(3),07,$nick,$chr(3)) has invited me to $+($chr(3),07,$chan,$chr(3)) $+ .
    join $chan
    .timer 1 2 msg $chan Hi, I'm7 $me $+ , I've been invited by $nick $+ . If I'm kicked 5 times this channel will be blacklisted, kicks left: $+($chr(3),07,$iif($readini(botinfo.ini,n,kicks,$chan),$calc(5 - $v1),5),/5,$chr(3),.) To remove me type $+($chr(3),07,!part $me,$chr(3)) - If you find any errors with the scripts please contact Sacro in #rawr on SwiftIRC
    ignore -iu300 $iif($address($nick,2),$v1,$nick)
    }
    else {
    notice $nick You can not invite me because your channel is blacklisted, join #rawr to get this appealed.
    ignore -iu300 $iif($address($nick,2),$v1,$nick)
    }
    }
    on *:pART:#: {
    if ($nick != ($ me)) {
    if ($nick($chan,0) < 1) {
    part $chan You need at least one other person to keep me.
    }
    }
    if ($nick == ($ me)) {
    msg #rawr I have just parted $+($chr(3),07,$chan,$chr(3),.)
    }
    }

    This as you can see, allows both Invite and Part triggers to be used, as no brackets seperating, would make the Part trigger disabled.

    And about ($ me), Yes this returns your current nickname, but it also works in the place of different settings, the reason //echo ($ me) returns your nickname, is because that is the current "you".
     
  6. Cfrey

    Cfrey Apprentice
    Banned

    Joined:
    Feb 19, 2007
    Posts:
    636
    Referrals:
    34
    Sythe Gold:
    0
    Intro to IRC Scripting

    Do you ever get some kind of problem where in your remotes the } didn't really end it? So basically when you run a script all the scripts below it go off :p. Pretty funny but I have that problem sometimes.
     
  7. Sacro

    Sacro Gunny - 168gr SMK Shooter
    $5 USD Donor Retired Sectional Moderator

    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    I personally have never had that, because i end them, and start again with new triggers. Without that trigger, the next script in the series will not start. Although i can see how it would happen. If you want, post your script and i'll have a look at it Cfrey =)
     
  8. Cfrey

    Cfrey Apprentice
    Banned

    Joined:
    Feb 19, 2007
    Posts:
    636
    Referrals:
    34
    Sythe Gold:
    0
    Intro to IRC Scripting

    I'll have to post it later when I move and get my computer back. Anyways I'll show you what it looked like

    On *Join* blah blah blah
    }
    On *Text* blah blah blah this is indented
    }
    On *Text* blah blah blah this one is indented too

    To fix it I had to add like

    }}
    }

    at the end of my thing to fix it. It was really weird.
     
  9. Sacro

    Sacro Gunny - 168gr SMK Shooter
    $5 USD Donor Retired Sectional Moderator

    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    This can be caused because your scripts are not properly halted, and react on the same trigger, If you had 2 text triggers for "blah" they would both coincidentally go off at that trigger.
     
  10. Cfrey

    Cfrey Apprentice
    Banned

    Joined:
    Feb 19, 2007
    Posts:
    636
    Referrals:
    34
    Sythe Gold:
    0
    Intro to IRC Scripting

    no no the blah blah blah crap was just the rest of the script they were both had different kind of triggers like !kill, !say !stats, !etc.

    I'll have to post the script later to show you.
     
  11. Sacro

    Sacro Gunny - 168gr SMK Shooter
    $5 USD Donor Retired Sectional Moderator

    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    Allright.
     
  12. Desir0

    Desir0 Forum Addict
    Banned

    Joined:
    Nov 28, 2008
    Posts:
    502
    Referrals:
    2
    Sythe Gold:
    0
    Intro to IRC Scripting

    Thanks for the guide.

    Never really had a clue about IRC bots/scripts etc.. This'll really give me a boost, cheers.
     
  13. Sacro

    Sacro Gunny - 168gr SMK Shooter
    $5 USD Donor Retired Sectional Moderator

    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    Your welcome, if you need some help, just send me a /query.
     
  14. Jordyboy

    Jordyboy Active Member
    Banned

    Joined:
    Aug 15, 2007
    Posts:
    163
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    mSL :)

    I used to be good at this also TCL when i had an eggdrop bot.
     
  15. k0pwner

    k0pwner Member

    Joined:
    Oct 28, 2007
    Posts:
    31
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    I am beast at script anyone needs any help pm me
     
  16. Sacro

    Sacro Gunny - 168gr SMK Shooter
    $5 USD Donor Retired Sectional Moderator

    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    I am also a beast with MSL, more so then you I'm guessing, please don't spam my threads for post count.
     
  17. Jordyboy

    Jordyboy Active Member
    Banned

    Joined:
    Aug 15, 2007
    Posts:
    163
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    With grammar like that, k0pwner. You obviously don't know any mSL apart from hawkee.com <_<
     
  18. Joshuaxiong1

    Joshuaxiong1 Newcomer

    Joined:
    Aug 9, 2008
    Posts:
    6
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    Hey I like that but I wonder why it is off instead of on. That's because the script are turned off?
     
  19. Sacro

    Sacro Gunny - 168gr SMK Shooter
    $5 USD Donor Retired Sectional Moderator

    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0
    Intro to IRC Scripting

    For the moment yes, i have that trigger turned off. Because I am not currently using bot-tags ([AA] etc.) I see no reason to limit channels.
     
  20. username66

    username66 Guest

    Referrals:
    0
< [Sell] Nice pure (Unfinished) | Free Acc 85 Fishing!! >


 
 
Adblock breaks this site