View Full Version : Help with Script!
crunch man
08-11-2009, 07:45 AM
Help me with this script please.
I tried to make a script that would change my desktop background (in windows Vista).
Please correct my scripting.
uuuh yea so here it is. I know i seem like a noob, but this is like one of my first scripts so yea.
Awkwardsaw
08-11-2009, 07:59 AM
well, from guessing, this is what i could come up with:
program ChangeBackground;
function FindColorNClick(var x, y: Integer; color, xs, ys, xe, ye, tol: Integer): Boolean;
begin
Result := findcolortolerance(x, y, color, xs, ys, xe, ye, tol); //it returns true if
//it finds the color
ClickMouse(x, y, True); //clicks the color
end;
var x, y: integer; //you forgot to set the variables
begin
Wait(3000);
Writeln('Clicking Minimize All Button');
ClickMouse(95, 785, True);
Wait(500);
Writeln('Right-Clicking Background');
ClickMouse(375, 644, False);
Wait(500);
Writeln('Clicking Personalize');
ClickMouse(390, 630, True);
Wait(2000);
Writeln('Finding and Clicking Choose a desktop background');
while not FindColorNClick(x, y, {you need to set these:} color, xs, ys, xe, ye, 5) do wait(100);
//while the color isnt found(the button) it waits.
ClickMouse(x, y, True);// you needed the x, y variables edit: sorry :p i forgot it would already be clicked. change it back
Wait(2000);
Writeln('Choosing a Background');
ClickMouse(320, 463, True);
end.
i hope you under stand my changes :) if not, pm me and i'll try to help you out
Coh3n
08-11-2009, 08:05 AM
I'm not saying this to sound mean or anything, but have you read any scripting tutorials? I ask this because your FindColorNClick function doesn't do anything, no offense. Also, you don't call on that function correctly. I'm not exactly sure what you were trying to do with that function.
I think you should read some of the beginner scripting tutorials in Tutorial Island. You'll lean a lot and by the end, making a script like yours will be easy as pie. :p
Again, if I sound harsh I apologize as I'm only trying to help you. :)
Cheers!
Awkwardsaw
08-11-2009, 08:08 AM
I'm not saying this to sound mean or anything, but have you read any scripting tutorials? I ask this because your FindColorNClick function doesn't do anything, no offense. Also, you don't call on that function correctly. I'm not exactly sure what you were trying to do with that function.
I think you should read some of the beginner scripting tutorials in Tutorial Island. You'll lean a lot and by the end, making a script like yours will be easy as pie. :p
Again, if I sound harsh I apologize as I'm only trying to help you. :)
Cheers!
hes just learning :) he already said he was going to check out my tut, atleast hes trying and asking for help :)
Coh3n
08-11-2009, 08:10 AM
hes just learning :) he already said he was going to check out my tut, atleast hes trying and asking for help :)
Lol, yeah I wasn't trying to be mean at all, I was just saying. ^_^
crunch man
08-11-2009, 08:14 AM
I'm not saying this to sound mean or anything, but have you read any scripting tutorials? I ask this because your FindColorNClick function doesn't do anything, no offense. Also, you don't call on that function correctly. I'm not exactly sure what you were trying to do with that function.
I think you should read some of the beginner scripting tutorials in Tutorial Island. You'll lean a lot and by the end, making a script like yours will be easy as pie. :p
Again, if I sound harsh I apologize as I'm only trying to help you. :)
Cheers!
I'M QUITTING!!!!!....jk
It wasn't harsh at all. I was trying to get scar to click on the red part of the icon in personalization for desktop background. Thanks for letting me know though.
Coh3n
08-11-2009, 08:16 AM
I'M QUITTING!!!!!....jk
It wasn't harsh at all. I was trying to get scar to click on the red part of the icon in personalization for desktop background. Thanks for letting me know though.
Oo if that's all you were trying to do you could have just used FindColorsTolerance, but I saw on your Calculator thread that Awkward already told you all about it. :)
Awkwardsaw
08-11-2009, 08:18 AM
Oo if that's all you were trying to do you could have just used FindColorsTolerance, but I saw on your Calculator thread that Awkward already told you all about it. :)
findcolortolerance, theres a huge difference in colors ;) just saying haha, i mix them up too
Coh3n
08-11-2009, 08:19 AM
findcolortolerance, theres a huge difference in colors ;) just saying haha
Either would work, but yeah your right FindColorTolerance would be better for a beginner. :p
Awkwardsaw
08-11-2009, 08:21 AM
Either would work, but yeah your right FindColorTolerance would be better for a beginner. :p
your right :) although
program New;
{.Include SRL/SRL.scar}
var tpa : integer;
begin
mousespeed := 10;
if findcolorstolerance(tpa, 6914286, 0, 0, 120, 20, 1) then
mouse(tpa[0].x, tpa[0].y, 0, 0);
end. is pretty simple imo
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.