Results 1 to 25 of 25

Thread: 1st script idea

  1. #1
    Join Date
    Jun 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default 1st script idea

    [This Post - Intro and Basic Idea]

    Hi, just like to introduce myself and let my idea be known before I start my first script hack of RS2.

    I have been lurking the innerweb for about 12 years now. I have a great IT job where I get access to lots of cool resources. I am more of a hardware/network guy, but I do dabble in programming from time to time. Most of my xp comes in OO programming and I am really ramping up my skills with Ruby. Scar seems a very natural dsl to learn. To the topic!

    So my first hack will be ambitious and I will like some feed back on the idea before I really dig in. Ruby teaches about a principle called DRY (Don't Repeat Yourself). PHP programmers and from what it seems Scar programmers are familiar with this principle in practice. Includes. SRL is an include library for Runescape Scaring. What I will do is layout the procedures for what I want to do and hopefully the community will assist with keeping my code DRY. Well here is the idea with no abstractions

    The script begins in Shilo Village. The skills needed are mining, crafting, and fletching. The idea is to mine gems, cut them, drop crushed gems, fletch them to bolt tips, and bank when necessary. All of these tasks will be done with efficiency in mind. The task should be performed on the least populated member world. A high level of anti-ban will need to be incorporated as not too many people are going to have an army of member bots. There is huge risk potential due to the fact that the script will be designed to run with a special forces unit of 4 elite bots. That means for 24/7 operation, a run time of 6 undetected hours will need to planned on.

    I understand this breaks with the philosophy of SRL to a certain extent. I do understand that some of the problems solved in making this a successful script may enhance many of the functions and procedures in the core, extended, misc, and skills libraries. Maybe eventually the solutions can extend those libraries.

    So that is the idea. If you are interested, stay tuned. I am going to start compiling some of the top level abstractions and laying out a model mapping for the tasks that need to be performed to pull this off. Thanks for reading and I look forward to contributing.

  2. #2
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    very nice idea...but why in shilo village?
    it looks like ull be a very interestng scripter
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  3. #3
    Join Date
    Jun 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default [This post - Top Level Abstraction]

    So here is a list of top-level problems to solve in logical order (in vacuum).

    Starting positions.
    Stand at door threshold to Shilo Village Bank. (There is a rug at the front door (may need to change to the two rocks just to left facing north of the carpet.))
    Hold pickax.
    Chisel in lower right inventory slot.
    Bolt tips in order of skill level and ability to cut in top left of inventory.

    Run to the mining rocks. (Run stays on)

    Find rocks and begin mining.

    Mine 7 rocks.

    Craft 7 rough gems with Chisel.

    Drop crushed gems.

    Determine ability to fletch cut gems in inventory.

    Fletch all cut gems with Chisel based on ability.

    Detect when inventory cannot hold more than 7 gems (inventory "full").

    Return to bank door threshold when inventory is "full".

    Find and open Shilo bank.

    Bank only cut gems, leaving bolt tips in inventory.

    Rinse and repeat.

    [This post does not take in to consideration anti-ban, random events, chats, player switching, world switching, stats, progress report, script options, forms, error trapping, or loop breaks. These procedures and functions will be categorized on a lower level of abstraction and handled by a special include library that I want to abstract away from the main .scar routine for this script]

  4. #4
    Join Date
    Jun 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by dan cardin View Post
    but why in shilo village?
    Dan,

    Nice stats! Well I picked Shilo Village for many reasons. In no particular order.

    I am intrigued by AI aspect of the anti-ban routines. Scripting member accounts seems to be very risky and that will be a good reason to develop tight anti-ban code.

    I think multi-skill scripts kick donkey and Shilo is the perfect place to develop three skill sets.

    I have spent so much time mining gems! I have over 200 cut diamonds that I picked from those rocks.

    I can't find a banker script that handles Shilo bank! There is no bank glass there! Thats what got me interested in finding Scar and SRL in the first place!

    I tested out Wizzup's GuildMiner and it worked out nicely. I studied the code while I was testing in Runescape. I thought I'd like to do something like that.

    The challenges involved in Shilo Village seem to involve tasks that I am not sure anyone has taken on. For instance, switching between mining and cutting gems while waiting for the rocks to re-spawn. I think that could be used in other scripts that would do similar things like Superheat mith to make bars inside the guild.

    Couple other reasons, I saw a guy who was buying 58k saph and 40k rubes

  5. #5
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    u r very in depth with this...and very un-newby for only 4 posts. 1 thing- dont double post. if u want help, i may not be the best person to ask...but i'll help ya
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  6. #6
    Join Date
    Jun 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default [This post - 2nd Level Abstractions]

    Here I will break out some of the sub-routines that may be required to complete the top level tasks.

    [Run to the mining rocks. (Run stays on)]

    [BankToMine]

    [MapWalkingExtension - Trapezium]

    When standing on the threshold to the bank (on the carpet(may need to change to the two rocks just to left facing north of the carpet.)) compass north(doesn't have to be perfect), the compass-map shows a couple of distinct symbols that shift around a little bit, but are never out of the scope of the compass map. They are: the Bank symbol, the furnace symbol, and the cart ride symbol (arrow pointing east).

    These symbols are useful for the first flag position. The symbols make up a triangle in the compass map. A fourth point can be added on the outside of the triangle to form a trapezium (American version). This point can be a random point that completes a trapezium (American version) with specific rules. This is the first flag point.

    [MapWalkingExtension - LineFromSymbol]

    Standing at the first flag point, the compass scope will always show a symbol. This symbol is: The cart ride symbol (arrow pointing east). Finding the point that completes a line from this symbol with line properties a random offset between -5 and -10 degrees from 0 and at the interior edge of the compass map (distance) will also find the 2nd flag point.

    Once at the second flag point, the gem rocks become visible in the compass map. The compass map will also always show the Quest symbol inside the house next to the gem mine. From here [MapWalkingExtension - LineFromSymbol] could be used again to find the final flag point that will arrive at the mines. An alternative would be to place the final flag point on top of any of the visible rocks.

    [Find rocks and begin mining.]

    Looks like gems rocks are "veined" instead of a solid color. Possibly a small extension to the mining skill would be needed here. I haven't dug in to the skills folder yet so more on this task later. For now, I will just call this sub-routine [MiningExtension - MineGemRocks]

    [Mine 7 rocks.]

    Very import to detect when 7 rocks have been mined. The idea here is to not be standing around doing nothing while waiting for the rocks to respawn. I can think of several ways to do this. The easiest way seems to be to create an integer variable that will hold the number of rocks mined so far and count each gem as it is mined. Once that integer hits 7, the variable resets back to 0. Another way would be to count the inventory spaces. It may be better (but more complex) to count the inventory spaces as counting inventory spaces will be a useful abstraction for a few other procedures at the second layer. So at this point, I am going to explore 2 options. [MinedRocksCount] and [ItemsInInventoryExtension - RoughGemCount]

    [Craft 7 rough gems with Chisel.]

    This is where it gets really interesting. Once I have detected that 7 gems have been mined, I will want to cut those gems. So I have to stop mining and start crafting! I there may need to be some extension done in the crafting skill to get this to work for gems. For now I will do the same thing here as with mining gems. [CraftingExtension - CraftRoughGem]

    [Drop crushed gems.]

    This seems trivial as various scripts have dropping items built in. The importance of this module is too provide seemless transition between crafting and fletching, while maintain inventory control. I'll call this one [PurgeInventory]. This module should look for anything in the inventory that is NOT a manifestation of a gem and is NOT a chisel. Then drop that item.

    [Determine ability to fletch cut gems in inventory.]

    Another important part of transition between crafting and fletching. This funtion will check the inventory for cut gems and only fletch those gems that meet the specified parameters. The parameters can be constants entered during player setup. I don't like static though, so I think a variable that holds the fletch level is needed here. The constant should be programmed as the level needed to fletch the gem and routine for checking the fletch variable against the constant should return a boolean value and pass as an argument to the fletch ability logic. This seems a little overkill, so for now, I will just work on building out the routine that will check for cut gems in the inventory and pass an argument based on player parameters. I also see an oppurtunity to abstract away an inventory layer. This is definately an area I need to research more. For now its simply [GetFletchLevel]


    [Fletch all cut gems with Chisel based on ability.]

    Once again I'll be using [FletchingExtension - FletchCutGem] with the arument passed from [GetFletchLevel]

    [Detect when inventory cannot hold more than 7 gems (inventory "full").]

    Very important time saver. Once the inventory is down to less than 7 slots, its a good idea to run to the bank and deliver all the gems that can't be converted in to bolts. Since there are only 7 gem rocks, it would be a waste of time filling inventory less that 7. Of course that number may need to be tweaked cause I can forsee some advantages timing wise to get the inventory down to say 6, 5, or even 4. The importance is to keep an eye on that inventory and recognize that it is "full" even when there are open slots. Again, here is another opportunity to abstract away an inventory layer. Again this is definately an area I need to research more. For now its simply [MaxInventory]

    [Return to bank door threshold when inventory is "full".]

    [MineToBank]

    This is going to be a variation of [BankToMine] which includes [MapWalkingExtension - LineFromSymbol] and [MapWalkingExtension - Trapezium]. Depending on how [BankToMine] gets pulled off, I made need to do something else like [MapWalkingExtension - SomeOtherGeometry]. This will require mapping in game and should be quite similar to what is done for [BankToMine]. One caveat is that [MineToBank] must return the flag directly on top of the original starting position. Either on the rug or on the rocks to the left of the rug. This will put the flag within reach of the NPC banker without moving again, and also keeps [BankToMine] in the loop.

    [Find and open Shilo bank.]

    Big research project here. For now its going to be [BankingExtension - ShiloBank]. The bank has no Booth or Glass or whatever. Its just 2 NPCs standing there. Have to be very careful not to move the flag when accessing the bank. I am currently looking at finding the NPC based on IsUpText. Still need to figure out how to keep the search within a small box scope and NOT look like a random search. I think this can be pulled off by creating very tight constraints to the search.

    [Bank only cut gems, leaving bolt tips in inventory.]

    I am thinking that this will be another banking extention that can use the abstracted inventory layer some how. So until I figure out how and where to implement an inventory layer or if it is even needed, I will just call this final step [BankingExtension - BankCutGem]

    [Rinse and repeat.]

    Here I will open up the idea of abstracting the functions that transcend the root of the script. This layer I will call [SRLExtension - MemberServicing]. Here are some of the subroutines I have in mind without a lot of detail. Of course you will recognize all of these. The importance here is to seperate these layers from the main .scar file for this script.

    [AntiBan], [RandomEvents], [Chats], [PlayerSwitching], [WorldSwitching], [Stats], [ProgressReport], [ScriptOptions], [Forms], [ErrorTrapping], and [LoopBreaks]

    More on [SRLExtension - MemberServicing] later. Probably MUCH later. For now, here is the model in two layers. The final layer will be the actual coding and I am sure that I will be doing some heavy editing of this post as well as the post on the Top Level. I am archiving changes as well. Your comments, critism, and feedback are greatly appreciated. To the CODE!!!

  7. #7
    Join Date
    Jun 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by dan cardin View Post
    u r very in depth with this...and very un-newby for only 4 posts. 1 thing- dont double post. if u want help, i may not be the best person to ask...but i'll help ya
    sorry about the double post. I am trying to keep the abstractions layers organized within the posts, and I wanted to respond to you outside of the script logic. Yeah its deep! That's the challenge of it though. I really would rather learn the language by starting out with something that challenges my comfort level.

    I have built a corporate knowledge base using Ruby and one thing that I learned from that experience is to try and layout the scope of the application in a well formatted model. This has several benefits. The model is always going to evolve over the course of development. A well formatted and laid out model will be a reference point when things change.

    Also, breaking down the model into abstractions layers creates natural benchmarks for testing. The layers create mini programs that can be tested before the app is completed. If I get stuck in a layer or module then I can move on to something else that needs work.

    Again sorry for the double post. Once I get this second layer down I am going to start looking through the SRL code to see what I can use.

    I know I am new here, so I don't want to start asking for direct help yet, but if you are offering, the first thing I am going to want to hammer out is the walking back and forth. I am still not quite sure how to find the compass scope (pretty sure its circular?). Once I find it, I think I know what to do with the flags.

  8. #8
    Join Date
    Feb 2007
    Posts
    169
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this looks really interesting
    too bad i cannot help as i have no members account
    i see your logic through all of this, just one question: why only seven gems at a time in the inventory?

  9. #9
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    well if u read tuts..then u can get a pretty good understanding of walking...but pretty much, in ur includes for scar, there is an include called mapwalk at scar(version)/includes/srl/srl/core/mapwalk...and u run that while logged onto rs...then move the window out of the way of the minimap. then u pick capture from client.

    then u pick how far out u want it to search(radius) and fill it in. then radius start and end. check it with the show path...and if its what u want then print procedure...and fill in the vars

    if u want a really in detail version..then use a tut
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  10. #10
    Join Date
    May 2007
    Location
    Canada
    Posts
    261
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sounds like a interesting idea. Just read up on some tutorials, look at other peoples code(if you end up copying it, remember to credit them) and you'll be scripting in no time. Its very fun and becomes pretty easy
    Don't be afraid to ask questions.

  11. #11
    Join Date
    Mar 2007
    Posts
    276
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow, i have a feeling hes going to turn into a wizzup? or something lol


    Someone: 'Who the hell is TooManySitUps?'

    Boreas: 'Switch the first and last letter of my name, what do you get?'

    Someone: 'Um, SoreAb?'

    Boreas: 'And how do you get that?'

    Someone: 'From Too Many Sit Ups!! Haha, Boreas you are so clever!'

    Boreas: 'Ya he's like my evil twin that takes over when I'm being really sarcastic, or playing devil's advocate.'

  12. #12
    Join Date
    Jun 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    @stuckman

    this looks really interesting
    too bad i cannot help as i have no members account
    i see your logic through all of this, just one question: why only seven gems at a time in the inventory?

    ==========
    Hi stuckman! Thanks for the feedback! I find this entire community to be very interesting and I really look forward to making this idea become a reality. I know I set high standards for myself and I don't think this will be easy. I really do appologize for picking a project that breaks away from SRL philosophy in the area of member scripts. I know Shilo village is members only, but some of the routines can be worked out and will become useful in non-member functions. For instance, checking inventory for item count and switching skills. Think about superheat items in the mining guild. Who wants to stand around waiting for mith to spawn when you can be superheating? That's why I need to break out of the mining loop, so my guys aren't waiting for respawn.
    ==========

    @dan cardin

    well if u read tuts..then u can get a pretty good understanding of walking...but pretty much, in ur includes for scar, there is an include called mapwalk at scar(version)/includes/srl/srl/core/mapwalk...[snip]

    ==========
    Excelent tip Dan, I will be checking that out now!
    ==========

    @tim46

    Sounds like a interesting idea. Just read up on some tutorials, look at other peoples code(if you end up copying it, remember to credit them) and you'll be scripting in no time. Its very fun and becomes pretty easy
    Don't be afraid to ask questions.

    ==========
    Hi tim! Thanks alot for the encouragement! You have no idea how much it means to me as newbie coder to hear people say how fun and easy it becomes! I will definately credit any code snipets I use to the original author and of course anyone who helps me work through this ambitious project. Thank you very very much for your support!
    ==========

    @kooldude

    Wow, i have a feeling hes going to turn into a wizzup? or something lol

    ==========
    Hi kooldude! Wow what a striking endorsement, if that is what it is! The first script I ran was wizzup's guildminer. I read the code while I watched it run and was very intrigued by the anti-ban stuff he does with the mouse movements. Very insightful and inspiring to what I want to pull off. I just want to sharpen my programming skills and this seems like a perfect place to do it! To Wizzup up if you read this: There will never be another Barry Sanders!
    ==========

  13. #13
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    yea...just by the way u set things up etc...i can totally see u being like wizzup or WT-Fakawi

    make sure u message me when ur done...id like to see it
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  14. #14
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wizzup or WT-Fakawi wouldn't make a thread explaining the script that they would make next.
    No offence, but i'm thinking you want someone else to make this script for you. hence it being under SRL Help, but this should be posted under requests.

  15. #15
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    im not saying he's one of them now! im saying once he knows more about the overall-ness of scripting...he will be really good. and yea i was wondering why he put it under help when all he was doing was outlining it...not reqesting or asking...just tellin about it...oh well (i still think ull be a really good scripter)
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  16. #16
    Join Date
    Jun 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I put it in help cause it's not really a request and I have already gotten soooo much help from all of the responses, including private ones. I am going to keep this thread up to date, so the need to help will evolve as the script evolves. In fact I should be posting some working code later this evening.

    So far I am still devouring the manuals and reading other code! I have my file laid out, but nothing that is ready to compile. Sorry if this is the wrong forum I really did look for the best place to post!

    Dumb question Log

    ============================================
    Should I start out with Scar 2.03 and SRL 3.6?, OR should I go for the latest and greatest. I have experimented in both so far. Suggestions welcome.
    ============================================

    ============================================
    What is this?
    Line 174: [Hint] (182:43): Variable 'NEWLINE' never used in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Globals.scar

    I checked and this is the code referenced.

    { var OldLine, NewLine, TheLine, TheName: String;
    Description: ChatLog vars. }
    var
    OldLine, NewLine, TheLine, TheName: string;
    ============================================

  17. #17
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    scar 2.03 with SRL 3.7

  18. #18
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    i use scar 3.06
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  19. #19
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you can ignore the newline, its just a hint, it was never used in SRL and is just telling you it was never used.

  20. #20
    Join Date
    May 2007
    Location
    Canada
    Posts
    261
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I personally use the "latest and greatest", but it boils down to what you like more.

  21. #21
    Join Date
    Apr 2007
    Location
    California
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Same, i use SCAR Divi 3.06 with SRL 3.7

  22. #22
    Join Date
    Jun 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default As promised, my first working script!

    Ok, this is nothing major so I hope no one is disappointed. I hope no one minds terribly that I am keeping this in Help! I am going to add some questions about some things that came up while I put this together.

    The program is called SRLExt.scar and demonstrates the use of custom includes. To get this to work, you have to extract the .rar to

    .SCAR 2.03\includes

    creating a folder called SRLExt with 2 files.

    SRLExt.scar
    WriteVersionNumbers.scar

    here is the output on my system.

    Script compiled using:
    SRL version number 3.70
    SCAR version number 2.03
    Successfully executed


    Well here you go!

    My question is, what would be the most efficient way to compare the version numbers to a constant that I will embed into any script as a requirement for running the script? The idea is to stop the script from running if the user is compiling with an incompatible version.

    Also, I would like to compare the version numbers to an array of constants so that if I create a script that is tested and compatible with multiple versions of SCAR and SRL then I can return true for that particular argument.

    And one more thing, I'd like to return the browser version and possibly information about the OS like screen resolution. Maybe even detect the RS2 version being run

    It's sort of a trivial question, but I would like some help with understanding compatibility issues across the SCAR/SRL versions. Thanks!

    Oh here is the file.

  23. #23
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    u dont need to keep them allseperate....u can have those with ur main script i think
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  24. #24
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    Errrr dont use 2.03 use Divi. If I am correct you are doing some walking and Dynamic DTM's are the best way to walk and are only available in Divi. Once you get the hang of this read the Tutorial in the advanced section on Dynamic DTM's they really aren't that "advanced" at all. And all the best, you look like you will be a great contributer to this community!
    Sleeping...

  25. #25
    Join Date
    Oct 2006
    Posts
    371
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Good Luck! But I won't be able to test it out, since I cannot use anymore money on RuneScape since I have gotten at least 10 accounts banned in the passed 3 months. Plus, I do not auto alot, I just pop into the community once in a while, and if I want to cheat I will, but not always. Maybe i'll use some of my friends accounts... We'll see. Once again, good luck!

    -Sebo

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Idea for script
    By alpine in forum RS3 Outdated / Broken Scripts
    Replies: 1
    Last Post: 05-03-2008, 09:43 AM
  2. First script idea
    By ss23 in forum First Scripts
    Replies: 24
    Last Post: 12-06-2007, 10:46 AM
  3. first script idea
    By mark9510 in forum RS3 Outdated / Broken Scripts
    Replies: 15
    Last Post: 11-01-2007, 11:40 PM
  4. Need a Script idea!
    By Hugolord in forum News and General
    Replies: 5
    Last Post: 06-02-2007, 03:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •