PDA

View Full Version : My First Script, Seller To Shop



kushal
01-17-2007, 02:12 AM
Its the first script i ever made, thanks to this guide:

http://www.sythe.org/showthread.php?t=205868

and some others.

This just right clicks and sells 10 to any shop that can buy it. The item has to be in first inventory place.

if anyone knows how to slow the mouse down or make this better please post here or edit it your self and then post it here.

please leave feed back.

danrox2004
01-17-2007, 02:49 AM
To slow down the mouse speed:
At the start of your script add MouseSpeed:= then whatever speed you want I think :confused: .
Also I think there is an SRL procedure to sell items...

Edit: Found it its in SRL/skill/BuySell.scar

procedure Sell(i, amount: Integer);
By: RSN
Description: Sells Items at specified Inv Slot

Usage: Sell(*Inventory Slot*,*Amount of items to sell*);

kushal
01-17-2007, 02:59 AM
how do i use it? do i just put that in there?

danrox2004
01-17-2007, 03:35 AM
Do you have SRL? If not download it from http://villu-reborn.com/showthread.php?t=3410 and follow the instructions. SRL is basically a library of useful functions and procedures which make Scar scripting in runescape alot easier.

When you have SRL at the start of any script you want to use an SRL function or procedure in you need to add in {.include SRL\SRL.scar}. and in the begin add in SetupSRL;
For example:
program New;
{.include SRL\SRL.scar}
begin
SetupSRL;
{Your Script Here}
end.

All functions in the folder core are included automatically when you SetupSRL but functions in other folders such as the skill folder are not I think :confused: .
So to use the procedure Sell which is in SRL/skill/BuySell.scar you will need to include it. To do this add to the top of your script {.include SRL\SRL\skill\BuySell.scar}.

Your script should now look like:
program New;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\BuySell.scar}
begin
SetupSRL;
{Your Script Here}
end.
You can now use the Sell procedure:

program New;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\BuySell.scar}
begin
SetupSRL;
Sell(1,30);
end.

I havent tested but this script should sell 30 Items from the first inventory slot.

Another thing, I just looked at your script and procedure FirstMessage, SecondMessage and ThirdMessage can all be combined into a function:

function WriteWait(text:string)
begin
wait(500)
WriteLn(text);
end;

Then in your main begin add in:

WriteWait('This will sell everything in your first inventory space');
WriteWait('to a shop until you stop it.');
WriteWait('Made by S.K.T.G');


Also try not to use until(false) in your script as according to the rules for autoing by WT-Fawaki there should always be a method to stop it. You may want to change that to:

until((IsFKeyPressed(12)) or (not ExistsItem(1)))

This should stop the script when F12 is pressed or there are no more items in Inventory slot 1.

Here is an edited version of the script (I havent tested it)

program Seller;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\BuySell.scar}

function WriteWait(text:string)
begin
wait(500)
WriteLn(text);
end;

begin
SetupSRL;
WriteWait('This will sell everything in your first inventory space');
WriteWait('to a shop until you stop it.');
WriteWait('Made by S.K.T.G');
repeat
Sell(1,10)
until((IsFKeyPressed(12)) or (not ExistsItem(1)))
end.

amned92
01-17-2007, 03:53 AM
One thing I have noticed is that you used MoveMouseSmoothEX, I as well as many other members on this form would recommend to NEVER use this procedure. Instead I would use Mouse. To use Mouse under the Program Name Insert {.Include SRL/SRL.SCAR}. After that change all of your MoveMouseSmoothEX to Mouse. Mouse looks like this

Mouse( x,y, random x, random y).

That means just put in the cordinate like normal then put something like 3 in for random x,y and it will add a little randomness to were it clicks. To make the mouse slower, before you start your script like before your main loop do MouseSpeed:=7 or another number ( higher is slower ).

One last thing, instead of HoldMouse( 586, 228, false ) do this HoldMouse( x, y, True) It will hold the mouse where the mouse already is.

Hope that helped.

YoHoJo
01-17-2007, 05:04 AM
Using the procedures which you did in your script will result in a ban for use.
Try using SRL procedures like everyone above has said.
I dont suggest that anyone use this script unless they want a ban =)

Good effort though,
Keep learning =)
Try learning how to use SRL

danrox2004
01-17-2007, 05:17 AM
If I were you I would read the SRL manual and get used to the SRL functions. Also look around in the Tutorial section if you want to learn more advanced things:
http://villu-reborn.com/forumdisplay.php?f=46

There is a good tutorial on using SRL etc... at http://www.megaupload.com/?d=9VLU1PU0

you need to download it but it is virus free and very good

kushal
01-17-2007, 08:15 AM
thanks, so many things i didnt know....ill try to fix it now.

in that thing u made danrox, this error keeps on coming, and i just updated my srl to the newest 1.

Failed when compiling
Line 155: [Error] (17819:1): Duplicate identifier 'Point' in script C:\Program Files\SCAR 2.03\includes\SRL\SRL\skill\BuySell.scar

the scar noob
01-17-2007, 08:42 AM
yes they are all right, use SRL my friend, it OWNS

kushal
01-17-2007, 08:48 AM
i use srl a lot but i never made a script with it, and what about that error?

kushal
01-18-2007, 03:11 AM
any1 know about that error?