PDA

View Full Version : My first two scripts



havoc928
08-12-2007, 05:09 AM
Hello everyone these are my first two scripts ever made in scar.

the first script is called uberafk what it does is autotalks and right click once every
twenty seconds. so if you have yo go to the bathroom and what not then this is a
good script for you to use.

the second script is called TREEKILLER what it does is that exactly. it is a very simple auto woodcutter it doesn't even drop the logs. all you have to do is set the constants then your good to go.

let me know what you guys think about all of this stuff. i will probly get flamed from posting this noob scar scripting. but hey im learning.

if anyone has suggestions or wants to help me out then PM me.
ohhhhh!! one more thing....how do i make it so it drops items?
should i use the movemousesmooth command to the cordinates or what?

thank you

Bourdou!
08-12-2007, 06:19 AM
Use DropAll. And if you want to drop only certain slots use DropExcept(2, 28) where that is drop inventory slot 2 to slot 28. I am pretty sure that is correct, but if it's not I learning this stuff to.
Hope it helps.

Tim0suprem0
08-12-2007, 06:24 AM
I like that your first post is with scripts you made. Good job! Keep it up and you'll be an experienced scripter in no time.

Sir R. M8gic1an
08-12-2007, 05:51 PM
here's a lil challenge that'll help you improve majorly... try combining both scripts. the wood cutter with the afk one, it'll make the script look more human (these are knows as anti bans).

btw its DropExcept(itemspotyoudontwanttodrop) or DropTo(startingspot,lastspot)
DropExcept(1)
DropTo(2,28)

first spot wont be dropped

Kik
08-12-2007, 06:19 PM
I just looked over your scripts - here's some tips and errors I found. Sorry if it looks like alot - I'm just trying to help.

- This isn't completely necessary, but it is good habit to put ';' after each command.

UBERAFK.scar

- you can use ActivateClient; to automatically switch over to the window specified by the crosshairs(RS)

- In your main loop, you put in wait(10000+random(2000));. You already have a wait time in your autospammer procedure, so I don't think that it is necessary(unless you want it to wait another 10 seconds). SCAR will wait until typesend completes typing before it starts typing something else.

- It is very detectable because your clickmouse procedure clicks in the same exact spot every time. In general, clickmouse is a very bad thing to use (many people say it's autoban). You could try using Mouse(600,300,5,5,false). Mouse automatically moves and clicks to a certain position. the '5,5,' is the xrand and yrand of the click. In other words, it is how much randomness the click has in pixels, so it won't click in the same spot. This will click between 595-605 and 295-305.
Also you could do something like Mouse((300+random(300)), (100+random(200)), 0, 0, false);

Other than that, a good first script. My first script looked a little like it

TREEKILLER.scar

I like your use of color finding

- .include si.text? Not sure what you mean by this - .include srl\srl.scar maybe. Also, loadinclude('woodcutter')? I guess these were just includes you have in your documents that we don't.

- pretty good script overall - something I might look into is colorfinding with tolerance (FindColorSpiralTolerance).

- You could use the DropAll; procedure (it drops everything in your inventory) or the DropTo(x, y) as some people above have said.

PM me or post here if you have any questions! These are all reccomendations - don't think that your script isn't good.

havoc928
08-13-2007, 04:21 AM
wow thanks for all of the help. i wasnt expecting to get all this help since im a noob and all. thank you...i will look into the tolerance and the drop all commands. that should help alot...im also looking for a more efficient way to find the tree colors. because sometimes it clicks on the ground or something

dvdcrayola
08-13-2007, 04:54 AM
you can make it check if it sees that you are hovoring over a tree using isuptext('Tree').. look in the text section of srl