Intro to IRC Scripting

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

Intro to IRC Scripting
  1. Unread #1 - Dec 15, 2008 at 6:43 PM
  2. Sacro
    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0

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

    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)
     
  3. Unread #2 - Dec 15, 2008 at 6:48 PM
  4. Pshynosis
    Joined:
    Nov 4, 2005
    Posts:
    2,160
    Referrals:
    1
    Sythe Gold:
    0

    Pshynosis POLIISI
    Do Not Trade

    Intro to IRC Scripting

    ...Into mIRC scripting ._.
     
  5. Unread #3 - Dec 15, 2008 at 6:49 PM
  6. Giddy
    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

    Giddy Legend
    Prince Yobabo Retired Global Moderator

    Intro to IRC Scripting

    Nice guide, I'm glad you posted one.
    Sacro knows his stuff.
     
  7. Unread #4 - Dec 15, 2008 at 10:32 PM
  8. Dustein
    Referrals:
    0

    Dustein Guest

    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>-
     
  9. Unread #5 - Dec 16, 2008 at 2:51 PM
  10. Sacro
    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0

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

    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".
     
  11. Unread #6 - Dec 16, 2008 at 9:07 PM
  12. Cfrey
    Joined:
    Feb 19, 2007
    Posts:
    636
    Referrals:
    34
    Sythe Gold:
    0

    Cfrey Apprentice
    Banned

    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.
     
  13. Unread #7 - Dec 16, 2008 at 9:19 PM
  14. Sacro
    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0

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

    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 =)
     
  15. Unread #8 - Dec 16, 2008 at 10:31 PM
  16. Cfrey
    Joined:
    Feb 19, 2007
    Posts:
    636
    Referrals:
    34
    Sythe Gold:
    0

    Cfrey Apprentice
    Banned

    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.
     
  17. Unread #9 - Dec 17, 2008 at 2:48 PM
  18. Sacro
    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0

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

    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.
     
  19. Unread #10 - Dec 17, 2008 at 7:23 PM
  20. Cfrey
    Joined:
    Feb 19, 2007
    Posts:
    636
    Referrals:
    34
    Sythe Gold:
    0

    Cfrey Apprentice
    Banned

    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.
     
  21. Unread #11 - Dec 17, 2008 at 7:41 PM
  22. Sacro
    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0

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

    Intro to IRC Scripting

    Allright.
     
  23. Unread #12 - Dec 18, 2008 at 12:28 PM
  24. Desir0
    Joined:
    Nov 28, 2008
    Posts:
    502
    Referrals:
    2
    Sythe Gold:
    0

    Desir0 Forum Addict
    Banned

    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.
     
  25. Unread #13 - Dec 18, 2008 at 3:23 PM
  26. Sacro
    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0

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

    Intro to IRC Scripting

    Your welcome, if you need some help, just send me a /query.
     
  27. Unread #14 - Dec 26, 2008 at 10:49 AM
  28. Jordyboy
    Joined:
    Aug 15, 2007
    Posts:
    163
    Referrals:
    0
    Sythe Gold:
    0

    Jordyboy Active Member
    Banned

    Intro to IRC Scripting

    mSL :)

    I used to be good at this also TCL when i had an eggdrop bot.
     
  29. Unread #15 - Dec 27, 2008 at 9:42 AM
  30. k0pwner
    Joined:
    Oct 28, 2007
    Posts:
    31
    Referrals:
    0
    Sythe Gold:
    0

    k0pwner Member

    Intro to IRC Scripting

    I am beast at script anyone needs any help pm me
     
  31. Unread #16 - Dec 27, 2008 at 11:48 AM
  32. Sacro
    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0

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

    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.
     
  33. Unread #17 - Dec 27, 2008 at 3:34 PM
  34. Jordyboy
    Joined:
    Aug 15, 2007
    Posts:
    163
    Referrals:
    0
    Sythe Gold:
    0

    Jordyboy Active Member
    Banned

    Intro to IRC Scripting

    With grammar like that, k0pwner. You obviously don't know any mSL apart from hawkee.com <_<
     
  35. Unread #18 - Dec 29, 2008 at 2:49 PM
  36. Joshuaxiong1
    Joined:
    Aug 9, 2008
    Posts:
    6
    Referrals:
    0
    Sythe Gold:
    0

    Joshuaxiong1 Newcomer

    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?
     
  37. Unread #19 - Dec 29, 2008 at 6:01 PM
  38. Sacro
    Joined:
    Jul 31, 2008
    Posts:
    1,983
    Referrals:
    0
    Sythe Gold:
    0

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

    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.
     
  39. Unread #20 - Dec 30, 2008 at 2:12 AM
  40. username66
    Referrals:
    0

    username66 Guest

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

Users viewing this thread
1 guest


 
 
Adblock breaks this site