Help - Search - Members - Calendar
Full Version: loadrgb help
AC Tools Everything Macro > AC Tool Macros > Macro Development
sammyz
CODE
Procedure SetRGB using CoordX, CoordY
  //Sets the RGB values from a particular location on the screen
  LoadRGB $CoordX, $CoordY
  SetConst RValue = {RGBRED}
  SetConst GValue = {RGBGREEN}
  SetConst BValue = {RGBBLUE}
End

Call SetRGB 211,406
If $RValue > 254 and $GValue > 251 and $BValue > 254
  MousePos 211,406
  leftclick
end


What I am trying to do here is have the script identify a certain color on the Coordinates 211,406 . I have used the search bar to help me with this, but only to find 2 related topics. When I try to run this script, I get a error saying "constant Rvalue cannot be found" Any help will be appreciated laugh.gif
DaMOB
QUOTE(sammyz @ May 24 2009, 05:47 PM) *
CODE
Procedure SetRGB using CoordX, CoordY
  //Sets the RGB values from a particular location on the screen
  LoadRGB $CoordX, $CoordY
  SetConst RValue = {RGBRED}
  SetConst GValue = {RGBGREEN}
  SetConst BValue = {RGBBLUE}
End

Call SetRGB 211,406
If $RValue > 254 and $GValue > 251 and $BValue > 254
  MousePos 211,406
  leftclick
end


What I am trying to do here is have the script identify a certain color on the Coordinates 211,406 . I have used the search bar to help me with this, but only to find 2 related topics. When I try to run this script, I get a error saying "constant Rvalue cannot be found" Any help will be appreciated laugh.gif

You can't copy and paste code (I recognize my code sample immediately) without the knowledge to back it up.

#1 Know the concepts of programming first as it is fundamental.
#2 Read the help.
#3 Read the README.TXT.
#4 Read the forums using search.
#5 Write your own attempt at the macro.
#6 When all of the first 5 things have been done, and we can tell on this forum if you have, then ask for help.

Thing is if you don't have #1 down or you might as well move along because no tool (not just ACTool) is going to do what it is you need it to do without you knowing #1. Some are easier than others for script kiddies but you still have to have the basic knowledge of programming or you will be pissing in the wind that is blowing in your face.
sammyz
QUOTE(DaMOB @ May 24 2009, 07:30 PM) *
QUOTE(sammyz @ May 24 2009, 05:47 PM) *
CODE
Procedure SetRGB using CoordX, CoordY
  //Sets the RGB values from a particular location on the screen
  LoadRGB $CoordX, $CoordY
  SetConst RValue = {RGBRED}
  SetConst GValue = {RGBGREEN}
  SetConst BValue = {RGBBLUE}
End

Call SetRGB 211,406
If $RValue > 254 and $GValue > 251 and $BValue > 254
  MousePos 211,406
  leftclick
end


What I am trying to do here is have the script identify a certain color on the Coordinates 211,406 . I have used the search bar to help me with this, but only to find 2 related topics. When I try to run this script, I get a error saying "constant Rvalue cannot be found" Any help will be appreciated laugh.gif

You can't copy and paste code (I recognize my code sample immediately) without the knowledge to back it up.

#1 Know the concepts of programming first as it is fundamental.
#2 Read the help.
#3 Read the README.TXT.
#4 Read the forums using search.
#5 Write your own attempt at the macro.
#6 When all of the first 5 things have been done, and we can tell on this forum if you have, then ask for help.

Thing is if you don't have #1 down or you might as well move along because no tool (not just ACTool) is going to do what it is you need it to do without you knowing #1. Some are easier than others for script kiddies but you still have to have the basic knowledge of programming or you will be pissing in the wind that is blowing in your face.


Yes this is your code and I highly appreciate it. #1 on the list is the hardest to do, I have completed #2-#5. I have really no skill in programming but I am really interested in learning. I just downloaded AC tool last night and came up with a small bot for a game that requires tons of clicking.


CODE
ActiveWindowcheck GAME
while 0 = 0
Isred 214,381 //monster 1
MousePos 310,417
delay 850
Leftclick
delay 75
Isred 214,381
MousePos 314,424
Leftclick
end
Isred 413,382 //monster 2
MousePos 510,414
delay 750
Leftclick
Isred 413,382
MousePos 507,410
delay 70
Leftclick
end
Isred 614,382 //monster 3
MousePos 710,415
delay 860
Leftclick
Isred 614,382
MousePos 708,419
delay 65
Leftclick
end
Isred 212,285 //monster 4
MousePos 305,323
delay 900
Leftclick
Isred 212,285
MousePos 308,326
delay 23
Leftclick
end
Isred 417,286 //monster 5
MousePos 505,321
delay 700
Leftclick
Isred 417,286
MousePos 508,326
delay 38
Leftclick
end
Isred 624,285 //monster 6
MousePos 716,328
delay 670
Leftclick
Isred 624,285
MousePos 714,325
delay 75
Leftclick
end
Isred 215,185 //monster 7
MousePos 303,226
delay 680
Leftclick
Isred 215,185
MousePos 306,230
delay 85
Leftclick
end
Isred 422,187 //monster 8
MousePos 497,214
delay 690
Leftclick
Isred 422,187
MousePos 500,217
delay 95
Leftclick
end
Isred 629,187 //monster 9
MousePos 706,224
delay 699
Leftclick
Isred 631,192
MousePos 703,220
delay 54
Leftclick
end
end
end
end
end
end
end
end
end
end


iswhite 250, 137 //chicken
delay 100
mousepos 787,590
leftclick
delay 10000
end

isgrey 614,492 //join game
mousepos 662,494
delay 450
leftclick
end

end


This is actually my first script for AC tool, so don't laugh! ph34r.gif All the colors it identifies are solid red, white, grey colors. I just want to further upgrade my bot to pick up items that have pink, yellow, orange colors. I hope this is enough knowledge to have to get help ^^
DaMOB
I don't laugh at people who honestly are trying. The thing is I am unsure if you are simply cut and pasting (I suspect you are) or do you have any inkling what you are doing. #1 has to come before all of the other things because it is your foundation. You can't build a house on quicksand. Well, you could but it will not last long.

Back in the old days you could learn very easily with Basic (in the 286/386/486 world Qbasic) and that would give you a good set of knowledge to build on now I don't know where to send you because they are all much harder to deal with.
sammyz
QUOTE(DaMOB @ May 24 2009, 08:40 PM) *
I don't laugh at people who honestly are trying. The thing is I am unsure if you are simply cut and pasting (I suspect you are) or do you have any inkling what you are doing. #1 has to come before all of the other things because it is your foundation. You can't build a house on quicksand. Well, you could but it will not last long.

Back in the old days you could learn very easily with Basic (in the 286/386/486 world Qbasic) and that would give you a good set of knowledge to build on now I don't know where to send you because they are all much harder to deal with.


Thank you for your input, one of my family members do have a copy of qbasic, I guess ill start from there. I know I took part of your work and apologize for doing so. The script above is 100% my work and I know it is very very basic. I just lack the knowledge onto making it more detailed. Thank you for pointing me in a direction I can start from, hopefully I can learn it fast so I can too in the future help contribute to this forum laugh.gif

Edit : (1 hour later), did some searching and looking at other peoples macros. I have learned A lot ! I am learning a lot faster than expected, so I will come back if I run into any trouble making my script more advanced!
DaMOB
QUOTE(sammyz @ May 25 2009, 02:01 AM) *
QUOTE(DaMOB @ May 24 2009, 08:40 PM) *
I don't laugh at people who honestly are trying. The thing is I am unsure if you are simply cut and pasting (I suspect you are) or do you have any inkling what you are doing. #1 has to come before all of the other things because it is your foundation. You can't build a house on quicksand. Well, you could but it will not last long.

Back in the old days you could learn very easily with Basic (in the 286/386/486 world Qbasic) and that would give you a good set of knowledge to build on now I don't know where to send you because they are all much harder to deal with.


Thank you for your input, one of my family members do have a copy of qbasic, I guess ill start from there. I know I took part of your work and apologize for doing so. The script above is 100% my work and I know it is very very basic. I just lack the knowledge onto making it more detailed. Thank you for pointing me in a direction I can start from, hopefully I can learn it fast so I can too in the future help contribute to this forum laugh.gif

No need to apologize since I put it out there several times for people to learn from. The only thing was I had the red lights come up when I saw a verbatim C&P of it with questions asking why stuff did not work.

Oh, once you learn the basics of logical thinking with loops etc... you will understand. I have been at this many many years where I was on basic for 2 weeks and immediately went to 6510 ASM as it all comes naturally to me. For others not so much while others are even more able to do stuff than I am.

Know your limits but at least have a foot in the programming world and you will really enjoy making stuff. I prefer the dark side of programming where I reverse engineer games and make things to help people. The one thing I do not make are things to help people do unattended combat.

Anyways, you will have fun and the learning is so fantastic you will get a high off of what you can do.
sammyz
QUOTE(DaMOB @ May 25 2009, 04:00 AM) *
QUOTE(sammyz @ May 25 2009, 02:01 AM) *
QUOTE(DaMOB @ May 24 2009, 08:40 PM) *
I don't laugh at people who honestly are trying. The thing is I am unsure if you are simply cut and pasting (I suspect you are) or do you have any inkling what you are doing. #1 has to come before all of the other things because it is your foundation. You can't build a house on quicksand. Well, you could but it will not last long.

Back in the old days you could learn very easily with Basic (in the 286/386/486 world Qbasic) and that would give you a good set of knowledge to build on now I don't know where to send you because they are all much harder to deal with.


Thank you for your input, one of my family members do have a copy of qbasic, I guess ill start from there. I know I took part of your work and apologize for doing so. The script above is 100% my work and I know it is very very basic. I just lack the knowledge onto making it more detailed. Thank you for pointing me in a direction I can start from, hopefully I can learn it fast so I can too in the future help contribute to this forum laugh.gif

No need to apologize since I put it out there several times for people to learn from. The only thing was I had the red lights come up when I saw a verbatim C&P of it with questions asking why stuff did not work.

Oh, once you learn the basics of logical thinking with loops etc... you will understand. I have been at this many many years where I was on basic for 2 weeks and immediately went to 6510 ASM as it all comes naturally to me. For others not so much while others are even more able to do stuff than I am.

Know your limits but at least have a foot in the programming world and you will really enjoy making stuff. I prefer the dark side of programming where I reverse engineer games and make things to help people. The one thing I do not make are things to help people do unattended combat.

Anyways, you will have fun and the learning is so fantastic you will get a high off of what you can do.


Haha it is a great high, I'm still up researching about programming and tweaking with my little bot smile.gif. Right now it only attacks monsters and picks up a certain rare item. This is for my melee character, thought it would have been easier before i made a healing mage which requires more knowledge on programming.
sammyz
ok, now I need some help. Please point me in the direction on how to make this shorter.




CODE
LoadRGB 202,409
  if {RGBRed} > 230 and {RGBgreen} < 165 and {RGBblue} > 228
    mousepos 211,406
    leftclick
  end
  LoadRGB 203,408
  if {RGBRed} > 230 and {RGBgreen} < 165 and {RGBblue} > 228
    mousepos 211,406
    leftclick
  end
LoadRGB 204,407
do this and that
end
LoadRGB 205,409
do that and this
end
LoadRGB and so on
that this
end


This way seems like it would take forever just to scan a small boxed area.
DaMOB
QUOTE(sammyz @ May 25 2009, 05:58 AM) *
ok, now I need some help. Please point me in the direction on how to make this shorter.




CODE
LoadRGB 202,409
  if {RGBRed} > 230 and {RGBgreen} < 165 and {RGBblue} > 228
    mousepos 211,406
    leftclick
  end
  LoadRGB 203,408
  if {RGBRed} > 230 and {RGBgreen} < 165 and {RGBblue} > 228
    mousepos 211,406
    leftclick
  end
LoadRGB 204,407
do this and that
end
LoadRGB 205,409
do that and this
end
LoadRGB and so on
that this
end


This way seems like it would take forever just to scan a small boxed area.

Use procedures with the using directive.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.