Jump to content

Welcome to Pure Warfare - The #1 Community for Pures

Welcome to Pure Warfare - The #1 Community for Pures, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of Pure Warfare - The #1 Community for Pures by signing in or creating an account.
  • Start new topics and reply to others
  • Subscribe to topics and forums to get email updates
  • Get your own profile page and make new friends
  • Send personal messages to other members.

Jay

Elite Member
  • Posts

    1749
  • Joined

  • Last visited

Everything posted by Jay

  1. Delete a total of five posts which were spam, or contained inappropriate content. Sorry Sirswat, though we're all fans of Taylor Swift, a secret forum in dedication to her isn't what we need. Maybe you should go to our entertainment forum and make a topic in her honor?
  2. Your First Script This tutorial is to help users who are brand new to mSL learn the basic process of writing a script. I will be assuming that you have already ready my An Introduction to mSL guide. A popular script amongst new coders is a "Perform" script. This is where the owner of the bot is able to make their bot perform commands remotely, such as ".do msg #PureWarfare Hey!" or ".do join #PureWarfare", etc. I will be walking you through the steps of how to make one of these scripts. Step One - The trigger. All remote scripts require a trigger to activate them. For this particular one, we will be using a TEXT trigger. A text trigger looks like this: When we add in our parameters, ours will be: ON *:TEXT:.do*:#: {} This means that the script will trigger when any users says a line that begins with ".do" in any channel. Don't worry, we'll add security later! Notice how I added an opening and closing bracket. These brackets will contain the entire script - all of your work for this script should go inside of these brackets. Step Two - Just Checking Now, because our trigger is ".do*" (note the wildcard), it will trigger on any line which begins with ".do". This means it will trigger on: ".do", ".do-hicky", ".dododododod", ".doyouunderstand?", etc. For this reason, we're just going to add an "if" statement to remember that the script and the user are on the same page. if ($1 == .do) { By using this statement, we make sure that the trigger the user is using is ".do", and nothing else. Now let's add it to our script. Don't forget to close that bracket! ON *:TEXT:.do*:#: { if ($1 == .do) { }} Now if we put our script within the brackets of that "if" statement, we'll be fine. Step Three - Who goes there? We don't want just anybody controlling your bot. For this script, we'll make it usable for you only. As it is not safe to do a check for a nickname (anybody could switch to your nickname and control your bot), we'll compare the address of the bot to the address to the nick. If they're the same (meaning on the same computer), then we'll continue. if ($address($nick,2) == $address($me,2)) { Now let's add that in, and once again don't forget to close that bracket! ON *:TEXT:.do*:#: { if ($1 == .do) { if ($address($nick,2) == $address($me,2)) { } }} Now we've made sure only you can use this script. But just for giggles, let's let users know when they've been thwarted by adding an "else" line after that "if" line. That means if the user is NOT you, it will perform the "ELSE" action, in this case, informing them that you won't be abused that easily! else { Let's add it in there after your if statement, with a little message within the brackets. ON *:TEXT:.do*:#: { if ($1 == .do) { if ($address($nick,2) == $address($me,2)) { } else { notice $nick Access denied! } }} Step Four - Get to work! Now that we've made sure your thoughts and the bot's are on the same page, and that the person using this is actually you, let's make the bot do what we tell it to. $($2-,2) $() is an evaluation identifier. We will use this so that you can use things such as "#" (to return the channel name), $nick, and variables within the command, and the bot will evaluate them. ON *:TEXT:.do*:#: { if ($1 == .do) { if ($address($nick,2) == $address($me,2)) { $($2-,2) } else { notice $nick Access denied! } }} Step Five - Enjoy. That's it! You're all done! Now you can remotely control your bot, and feel safe doing it. Go ahead, give it a shot, ".do msg # Hey there!". You're the boss now! Congratulations, you've made your first script. - Jay
  3. I've added a section called "Tokens", I hope that helps you. If you still don't understand, tell me what's confusing you and I'll go more in-depth.
  4. Jay

    Help

    Closed. The question originally asked has been addressed and resolved.
  5. An Introduction to mSL. Index • Introduction • Bracketing • Tokens • If-Then-Else • Variables • Remotes • Aliases • Conclusion Introduction mSL (mIRC Scripting Language) is definded as "a powerful scripting language that can be used both to automate mIRC and to create applications that perform a wide range of functions from network communications to playing games." Bracketing The mSL, like other languages, uses brackets to organize scripts. An opening bracket is "{" and a closing bracket is "}". The key to the bracket system is that your brackets must balance. If you open a bracket, you must close it by the end of the script. The best way to think about bracketing is as a roadway. Take a look at the script below: alias checkme { if ($me == Jay) { echo I am Jay! } elseif ($me == Karl) { echo I am Karl:( } else { echo Who am I?! }} The first bracket is opened on the first line, "alias checkme {". This bracket opens the entire script, all components of the script must fit inside of this bracket and the final bracket, which will be at the very end. Next is another bracket opened on the "if ($me == Jay) {" line. If the condition in this "if" statement is true, all commands within this opening bracket and the next closing bracket which will close the statement are executed. If not, the script will skip ahead to the beyond the closing bracket which would have closed this opening bracket. So if $me does equal "Jay", all commands until the closing bracket which will end this statement are executed, which would be "echo I am Jay!". If $me does not equal "Jay", it will skip to the closing bracket which ends the statement, which would be the "elseif" line. Below is a script which does not have balanced brackets. I've colored the opening and closing brackets of the same statement so you can see how they match up. alias example { if ($1 == 1) { echo It's one. } else { echo It's not one. } As you can see, the original opening bracket (the red one) is never closed, which will cause problems with this script as well as any scripts after it in the file. Tokens Tokens are what mSL uses to identify certain text within a line. Here are some examples to help you understand how tokens work. "Hello there my name is Jay!" $1 equals Hello $4 equals name $1-2 equals Hello there $3- equals my name is Jay $0 equals 6 (the number of tokens in the line) $1- equals the entire line, Hello there my name is Jay! Let's apply this to a simple script. ON *:TEXT:!calc*:#: { notice $nick $2- equals $calc($2-)} The above script would trigger when a user enters a line which begins with "!calc". That would mean $1 is always !calc, or anything that begins with calc. Therefor $2 is where the calculation to be performed begins. In order to get the entire calculation, we use $2-. If-Then-Else All scripting is based on an "If-Then-Else" format. The principal idea of this is if a condition is true, then an action is carried out, else it is not. It looks like this: if { then}else { then} Using this format, you can create a script to perform a certain action if a condition is true, and do something else if it is not. For example: if (1) { then}else { then} Notice that there is only a condition for the "if" statement. This is because the "if" statement is used to execute a command if a certain condition is true, and carry on if not. If you would like to check for multiple conditions, you would use elseif. if (1) { then}elseif (2) { then}else { then} An "elseif" statement can only be used after an "if" statement, and will only be checked if the "if" statement before it is false. Here, let's try putting it to use. alias checkme { if ($me == Jay) { echo I am Jay! } elseif ($me == Karl) { echo I am Karl:( } else { echo Who am I?! }} Above is an alias called "checkme". When you enter "/checkme", your script will first check if "$me" (an identifier which returns the nickname on which the script was activated) is equal to "Jay". If so, it will echo "I am Jay!". If not, it will go to the next "elseif" statement, and check if "$me" is equal to "Karl." If so, it will echo "I am Karl:(", if not it will carry on to the next "else" statement, which will then echo "Who am I?!". Variables There are two types of variables: global(dynamic) and local. The difference between them is that a global variable is saved until it is unset, and a local variable is only saved for the duration of the script. To set a global variable: /set %var value To set a local variable: /var %var value Once you save a value to a variable, you can call back that variable by using the %var name you assigned to it. alias myage { set %age $1}alias sayage { echo I am %age years old!} You can also use evaluation brackets ([ ]) when setting a variable. This can be used to assign static variables. For example: ON *:TEXT:!setage*:#: { set %age. [ $+ [ $nick ] ] $2}ON *:TEXT:!myage:#: { msg $nick You are %age. [ $+ [ $nick ] ] years old.} For more help with variables, type "/help variables" in mIRC. Remotes A remote is something that is triggered by an action in IRC. Some examples are "ON TEXT", "ON NICK", and "ON INVITE", all of which I will be showing examples of in this section. The format for an ON TEXT remote is as follows. ON - Signals to mIRC that this line is a trigger. Tip: If you would like to disable a trigger, an easy way to do so is by changing this to "OFF". <level> - This refers to the userlevel (/help /auser) of the person triggering the script. 99% of the time this will be a wildcard, *, indicating any user level. :TEXT: - This tells mIRC what type of trigger it is. <matchtext> - This is where you put the actual trigger of the script (such as !stats* or !commands). A wildcard may be used here. Wildcards (*) can be used to match any amount of characters. :<*><?><#>: - This is where you indicate the location of the trigger. ? refers to in a private message, # means in a channel (you can specify with #Channel, or #Chan1,#Chan2 etc), and * means either. <commands> - this is where you use an opening bracket and then continue on with your script. An example trigger, which will will trigger on the text "!help" only, and only in a channel. ON *:TEXT:!help:#: { Another example, which will trigger on any text which begins with "!stats", and is said in #PureWarfare. ON *:TEXT:!stats*:#PureWarfare: { The format for an ON NICK trigger is as follows. Nothing new is introduced with this trigger, though you should notice there is no location (#?*) parameter, and there is no <textmatch> parameter. This is because a nickname change does not occur in any one specific location, and because there is no text to match. A typical ON NICK trigger looks like this: ON *:NICK: { The format for an ON INVITE trigger looks like this: Notice that this trigger also does not have a textmatch parameter, though it does have a channel paramater. For all channels, use "#", for a specific channel use "#Chan", and for multiple channels use "#Chan1,#Chan2,etc". An ON INVITE script may look like this: ON *:INVITE:#PureWarfare: { join $chan } Aliases There are two types of aliases - identifiers and commands. You can determine how the alias is being used with the identifier "$isid", which will return $true if the alias is being used as an identifier, and false if it is being used as a command. Identifiers Identifiers, for the most part, are used to evaluate information and return it. Aliases used as an identifier look like: $alias An example of an identifier looks like: alias whatsmyname { return $me } Note that "return" is used to return the value of your $alias. Once "return" is used, the alias stops. The above alias could be used in a way such as, "msg $chan Hello my name is $whatsmyname $+ !" Commands A command alias is simply used to perform multiple commands at ease with a simple /command. An exampe of a command alias looks like: alias whatismyname {echo $me} The above alias could be used as "/whatismyname". You could combine both of those like this: alias whatsmyname { if ($isid) { return $me } else { echo I am $me $+ . }} Note how the $isid identifier is used to determine the output, and how the brackets are balanced. Conclusion I hope everything you have read in this guide has helped you understand the basics of beginning to use the mSL language. Please be aware that this guide covers only a few topics, and vaguely. If you have any questions, post them here and they will be answered. You can use the /help command in mIRC to view the mIRC Help files. Please take a look at my other tutorials for more advanced scripting help! -Jay
  6. Due to the fact that a big part of Pure Warfare's community is set on IRC, I believe that a forum dedicated to mSL would be a good addition to our forum. Below you will find some rules and guidelines concerning the mSL Forum. Be sure to read this entire topic before posting. Posting Topics As I do not expect too much activity dedicated to mSL in our forums, I see no need to make multiple sub-forums within this one, such as Script Requests, Script Showcase, Script Help, etc. For that reason, I would like all users to use the following suffixes to their titles when posting new topics. [script] - When posting a script you've written. [Help] - When you are requesting help on a script or with a certain topic. [Request] - When you are requesting a script. [Tutorial] - When posting a guide to a certain subject. Rules No Spamming - Do not post on a script unless you have an intelligent comment/suggestion/question/etc. Useless posts will be deleted. No Flaming - The idea of this sub-forum is for our users to learn. For that reason, do not mock a user for asking a question, making mistakes, or posting scripts you don't like. No Plagiarism - If you're going to post a script which you did not write, give credit to the person who did write it. If you received help or used snippets from another script, give credit.
  7. I like this idea, I'll personally work on adding the sub-forum(s) and possibly appointing a mod or two to be assigned to the mSL subforum. Thank you for your suggestion!
  8. Since Pure Warfare's release not too long ago, there has been a lot of discussion about Pure Warfare's slogan (more specifically, the lack of one.) The staff have put a lot of thought into it - we've all read over the suggestions topic numerous times, and made suggestions of our own, to see what the users would think. Ultimately, we have decided that the best way to determine the favorite slogan would be to post a poll, which would include all of the suggested slogans which the staff has deemed appropriate. The poll will be open until Saturday, at which time the staff will look over the top choices, and continue on from there. Note: "Venimus, Vidimus, Vicimus." means "We came, We saw, We conquered".
  9. I really appreciate the post, Nav, I like your ideas, and when the time comes, this will be something I'll work off of. Personally, I can't wait for the time to come when Pure Warfare can host it's own tournament. I'd love to be the head of that project(: I'm going to leave this topic as is - perhaps you'd like to add ideas, or other users can post feedback or suggestions. Just keep in mind when posting on this topic - do not post uselessly. I'm beginning to crack down on spam now. If you don't have something to contribute, don't post. Thanks, Jay.
  10. Perhaps grey as the primary color, a shade of blue as the secondary.
  11. Well, I don't particularly feel like downloading PhotoShop, so I was hoping one of you fine lads (or ladies) could make me an avatar. I'd just like it to say "Jay" in Old English font (or something similar), and you can do whatever you'd like with the rest of it. Be creative? I'd really appreciate any submissions!
  12. Especially your parents!
  13. kill 1 by 1 (that way we could keep the office and appoint new staff) die in a fire or drown
  14. Jay

    Possible Slogans

    Pure Warfare :: Now 100% Sefket-Free. Pure Warfare :: We've got the Mudkips. Pure Warfare :: wat Pure Warfare :: Why not?
  15. Haha:) Good to see another friend join the community.
  16. Clans are already beginning to post their war results on Pure Warfare, and some are doing so ONLY on Pure Warfare.
  17. Jay

    Post your desktops!

    I blocked out my IP & Town(: The background is "Kay", my girlfriend.
  18. A Day To Remember?! iloveyou.
  19. hswdtd Very off topic, but look what I just found! Hover your mouse above that ^ [acronym=Holy **** What Does This Do]hswdtd[/acronym] SWEET.
  20. Here, I'll add a poll to this topic and see what people think.
  21. Jay

    Jay

    Yes, I was the site's first moderator.
  22. What a great summer! You return to Fatality, and then join us at Pure Warfare!(: Glad to see you, Charles. Welcome to the Revolution.
  23. Jay

    Hello sir.

  24. I'd recruit him quick. He has fire runes. :)
×
  • Create New...