Jump to content
lazarbeam

[Buyer] [2007] Shop N' Hop - A Universal Buyer

Recommended Posts

Shop N' Hop

A Universal Buyer

Version: 0.15

Release Date: 3.16.2013

Version Date: 3.28.2013

 

Version History:

v0.1 - Initial release.

v0.11 - Critical bug fixed which only allowed 1 item to be bought.

v0.12 - Tremendous speed increase of script by also checking for the text color of the shop stock when a purchase is being made (it fades for a split second). Previously, I had to have a long wait to wait for the text to turn back to its normal color, otherwise the script thought there was no stock available. That wait has been shortened to allow buying at least 2x faster (but still within human-like movement).

v0.13 - Attempted fix of a bug when getting stuck on world selection screen. Quicker to start buying once the shop opens.

v0.14 - Proper bug fix of stuck on world selection screen

v0.15 - Included anti-leech, and did a little optimization.

v0.17 - Thanks to Janilabo for an awesome update to the script while I've been absent studying.

 

Description:

Uses user-defined settings to purchase items from a shop, then switches worlds. Added in changing camera to maximum height to easily find NPC.

 

Instructions:

Update to the lastest MSSL include, and the latest OSI for SMART (file->Includes Manager).

Run this script from login or in-game while your character is in or near a shop.

Complete lines 31-38 with your personal shopping preferences:

 

  • uname
    • This is your username for logging back into the game after switching worlds.

    [*]pword

    • This is your password for logging back into the game after switching worlds.

    [*]npccolors

    • These are the colors of the NPC to trade. Use the color picking tool and paste the colors in square brackets, separated by commas.

    [*]npcname

    • The name of the NPC you wish to trade. A full name isn't required, but at least something distinguishable.

    [*]npctradecommand

    • The command used to open the NPC shop. In most instances, this is 'Trade.'

    [*]slotstobuy

    • These are the slots from the shop you wish to buy. Please refer to the image below for more details. Place slot IDs in square brackets separated by commas.

    [*]buylimit

    • The quantities at which you want the script to stop purchasing from the store if the stock is below this limit. Useful for not spenidng too much on an item. The index of this variable corresponds with the index of slotstobuy. Place slot IDs in square brackets separated by commas.

    [*]excludeworlds

    • Worlds to NOT hop to. These are worlds that get too full to switch, or maybe worlds too laggy for you. The defaults of the script are the worlds that get full during peak hours.

 

slotstobuy

The image below shows the ID of the slots from the store you will be buying from:

ShopID.png

 

There is no (current) check for running out of money. Please have plenty before running.

Items must have a stackable quantity in shop.

Will only buy in 10's.

 

Post bugs and whatnot below.

ShopAndHop v0.15 SMART.scar

ShopAndHop v0.17 SMART.scar

Edited by lazarbeam
Link to comment
Share on other sites

Very nice job lazarbeam, that's a masterpiece!

Glad to see you released this. :)

 

Really recommend you'll make this support SMART though, because it's really couple simple changes that it takes.

 

Attached you the script with the changes it took to add support for SMART (this can be disabled by commenting out SMART's define)

 

Regards,

-Jani

ShopAndHop.scar

Link to comment
Share on other sites

Very nice job lazarbeam, that's a masterpiece!

Glad to see you released this. :)

 

Really recommend you'll make this support SMART though, because it's really couple simple changes that it takes.

 

Attached you the script with the changes it took to add support for SMART (this can be disabled by commenting out SMART's define)

 

Regards,

-Jani

I had absolutely no clue what SMART was before about 2 hours ago... I've been out of the SCAR scene for several years. From what I can tell, it's like running in a VM?

I'm certainly going to look into it, and make the appropriate changes to the script.

 

Edit: Certaining playing in SMART from now on, haha!

Edited by lazarbeam
Link to comment
Share on other sites

Yeah, Wanted and Freddy did awesome job with SMART for SCAR Divi 3.38.01+! :P

 

Also, I updated this another awesome buying script by you to SMART earlier: http://forums.scar-divi.com/showthread.php?2165-2007-Gnome-Stronghold-Arrow-Tip-Buyer&p=12423&viewfull=1#post12423 ;)

 

By the way, I noticed you will have to add MoveMouse's for SMART if you use ClickMouse().

Also add small delay (~25 ms.) after that MoveMouse*() procedure, before you use ClickMouse*() procedure - so that SMART has enough time to register it.

I noticed this while testing stuff..

 

Although, if you don't want to worry about those, simply replace ALL of your ClickMouse()'s with RS07_ClickMouse() - it takes care of the problems I mentioned up there (MoveMouse + delay). :)

 

-Jani

Edited by Janilabo
Link to comment
Share on other sites

Thanks for the info. I typically don't just go for a ClickMouse() command without a MoveMouse() anyways (to check UpText), just depends on how careless I'm being.

This script ran flawlessly for me in SMART for about 10 world hops, so it should be good to go.

Link to comment
Share on other sites

Thanks for the info. I typically don't just go for a ClickMouse() command without a MoveMouse() anyways (to check UpText), just depends on how careless I'm being.

This script ran flawlessly for me in SMART for about 10 world hops, so it should be good to go.

Yeah, I noticed the problems because my powerminer kept missing the drops (that it wouldn't do without SMART), if/when I didn't use MoveMouse + delay before using clicking.. :P

So I worked it out and fixed it for RS07_ClickMouse and other RS07_ clicking procedures.

 

RS07_ClickMouse() is a great mouse procedure anyways, because its pretty humanlike (there's that random wait between the hold and release of mouse button), so its anyways better in comparison to ClickMouse (which is an instant click, without wait between hold and release)

 

I can see this become pretty popular script btw, I like your way of doing an universal buying script! Genius. :P

Link to comment
Share on other sites

RS07_ClickMouse() is a great mouse procedure anyways, because its pretty humanlike (there's that random wait between the hold and release of mouse button), so its anyways better in comparison to ClickMouse (which is an instant click, without wait between hold and release)

Is that the same for RS07_Click()?

 

I can see this become pretty popular script btw, I like your way of doing an universal buying script! Genius. :P

 

I was getting a few PM's about the Gnome Stronghold buyer that I wanted to update it but didn't like how limited it was

Link to comment
Share on other sites

Is that the same for RS07_Click()?
No, because RS07_Click() performs click to current position, so it doesn't require any movement. :) So, RS07_Click() wasn't problematic with SMART at any point.

 

Unless you are asking, if RS07_Click() contains the same humanlike behaviour with holding the button and releasing? Yes, it does. :P

 

-Jani

Link to comment
Share on other sites

Thanks for this script mate! huge fan.

 

Was wanting to ask a small favor though, from my limited knowledge i would think it would be rather straight forward.

But could you make a script that combines the feathers with the shafts, and the headless shafts with the arrow tips?

Using this script for 5 hours requires me to spend about 3 hours making arrows.

 

Thanks again!

-reyno

Link to comment
Share on other sites

Thanks for this script mate! huge fan.

 

Was wanting to ask a small favor though, from my limited knowledge i would think it would be rather straight forward.

But could you make a script that combines the feathers with the shafts, and the headless shafts with the arrow tips?

Using this script for 5 hours requires me to spend about 3 hours making arrows.

 

Thanks again!

-reyno

 

That wouldn't be too difficult nor cumbersome at all.

Consider it done!

Link to comment
Share on other sites

Haha, my appologies!

When I have access to my laptop on which this script it stored, I will re-upload it (likely tomorrow) (my fiancee borrowed it for school)

 

Awhile back, it wouldn't allow me to upload files, so I left it with the intention of re-uploading at a later time when that was fixed, and forgot!

Link to comment
Share on other sites

Nice work with this script mate!

 

Although, I must say:

I am totally, TOTALLY against anykind of antileech features (lite and pro versions are better solution in my opinion), but of course its your call if you want to keep antileech in, as its not against the rules at SCAR-Divi.com... :)

SRL (Villavu) community made a wise decision for not accepting any scripts with antileech in em (that means, it's against the rules over there now).

I really wouldn't worry about this script "raping" (if thats what you are concerned off of) RS07, not that it aint a great (it's awesome!) and working script, but mostly because there's plenty of bots around already, that are easier/faster for everyone to setup AND they solve antirandoms and crap aswell (for example TRiBot, but also many private ones).. +The fact they can run multiple bots aswell so.. Ugh.

 

Doing this (well, having antileech) might drop out some really potential scripters from this community in the future (even if they are just bigass leechers right now).

..but! Of course, doing this, might ALSO (obviously) encourage some of em to script.. So it's pretty 50/50 I guess?

However, in my opinion people just get into scripting a lot more often if/when they see things (scripts for macros and bots) work smootly and without any obstacles or problems in the way. ;)

These are just my opinions/feelings though, not that this crappy talk really means anything, I am pretty much just ranting around. xD

 

Something I posted to SRL community a while ago about antileech stuff: http://villavu.com/forum/showthread.php?t=97294&page=2&p=1184357#post1184357

 

Ontopic: You could easily remove (replace) 'worlds' TIntArray from your script, because there's RS07_Worlds TIntArray built-in to MSSL, which is exactly the same as your worlds TIntArray - you can blame me for not documenting it though, so god damnit (at me)! :D

That way you'll save memory a bit (tiny bit, LOL). :) But that way there isn't that array twice, so its smart thing to do.

 

Keep up the good work LB! Can't wait to see what you can come up with in the future (especially after walking and antirandoms will be solved in OSI - big thanks to James and slacky for working on those things).

 

-Jani

Link to comment
Share on other sites

It appears my previous response didn't send!

Love this script, its pretty much flawless, occassionally have to move character back to the NPC if its a moving one!

However

BIG ISSUE:

If 0 appears at any point in the buy limit.. I.e 490 left. It'll stop and change worlds.

I need to get it to run it to 0!

How would I do that?

Thanks again!

Link to comment
Share on other sites

It appears my previous response didn't send!

Love this script, its pretty much flawless, occassionally have to move character back to the NPC if its a moving one!

However

BIG ISSUE:

If 0 appears at any point in the buy limit.. I.e 490 left. It'll stop and change worlds.

I need to get it to run it to 0!

How would I do that?

Thanks again!

 

I'll certainly look into it ASAP. I never bought multiple items to 0. I usually buy 1 item to 0, or buy multiple items to a number far above 0.

If you're only buying 1 item to 0, arrange the order of the arrays so that item is last to buy. Otherwise, I'll look into a fix

 

And thanks for the feedback. I've ran this script several days on end with no hang-ups (though, the NPC i'm buying from is pretty contained)

 

 

EDIT:

I'm unable to replicate the problem. I can't quite pinpoint where the script is messing up. Perhaps there's a problem with the coordinate of the shop quantity of the slot you're buying from.

Which slots are you buying? And on which one do you hop after buying out?

Edited by lazarbeam
Link to comment
Share on other sites

I'll certainly look into it ASAP. I never bought multiple items to 0. I usually buy 1 item to 0, or buy multiple items to a number far above 0.

If you're only buying 1 item to 0, arrange the order of the arrays so that item is last to buy. Otherwise, I'll look into a fix

 

And thanks for the feedback. I've ran this script several days on end with no hang-ups (though, the NPC i'm buying from is pretty contained)

 

 

EDIT:

I'm unable to replicate the problem. I can't quite pinpoint where the script is messing up. Perhaps there's a problem with the coordinate of the shop quantity of the slot you're buying from.

Which slots are you buying? And on which one do you hop after buying out?

 

Hey man,

 

Thanks for looking in to the issue, its done it with bronze arrows from Ardougne GE, Body and Mind runes from Varrock, its done it with ALL stackable items I've tried.

Its not ALL the time.. I'd say 1/2 of the time, I've been using quantity 103 or somet to get say Body runes from 5000 to 103, but sometimes say it hits, 4103, it'll hop. SOMETIMES.

The shops stock is 5000, so I should get around 4k runes before I hop, but he just hops randomly really!

I love the script though, it gets used ALL the time.

and I'm super thankful for it as it is, just takes a while to get the amount I'm after :)

 

Cheers man!

You're a gent!

Link to comment
Share on other sites

I missed your reply to my post, so I haven't looked into it yet with the info you've provided me.

 

Another question: Is this being ran in SMART? The script would mess up a bit after awhile in SMART for myself when running for long periods (I thought I had fixed this though). I've been running this in a XP virtual machine very well (TinyXP).

Anywho, it's likely a problem with the function I used to retrieve the quantity from the shop; I was never fond of the code I have for it.

I'll try to look into it more within the next 3 days (2 homeworks due Wed and they'll take 5-6 hours each [i'm a math graduate student]).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
  • Create New...