Scar color

Discussion in 'Code Snippets and Tutorials' started by Billy, Mar 20, 2007.

  1. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    is is possible to do something like this( sorry if its hard to tell what im trying to say)
    Code (Text):
    1. findcolor(x,y)=var1
    2. if var1=12345678 or 87654321 or 41327980 then loop;
    3. else
    4. presskey(12)
    ok a little confusing (i hardly know what i am saying
     
  2. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    more like
    Code (Text):
    1. If getcolor(////mouse co ords//219,420)=14144972///bitmap number
    this is explained in the advanced scar tutorial
     
  3. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    can i do something like
    Code (Text):
    1. if getcolor(////mouse co ords//219,420)=14144972 or 1234567 then loop;
    2. else presskey(16);
    3. loop;
     
  4. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    use case then. I would get the scar tutorial in the stores should answer all your questions. Or else if
    if ////color thing then
    //what to do
    Elseif ////color Then
    //what to do
     
  5. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    i have the tutorial and it is very helpful it is just that sometimes it doesnt have all the answers. sorry if i am bothering you all the time with all of my scar questions.
     
  6. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    no problem. Happy to help
     
  7. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    im sorry to be back but i have another question. is it possible to count the number of thime a bitmap appears on the screen?
     
  8. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    Maybe. I do not know the code if it is possible
     
  9. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    ok, i am still full of questions, so i am sorry again if i am bothering you. ok first, when scar searches for bitmaps, does it search only the visible part of the screen or can it find thing that arent currently visible unless you scroll down(that might be worded oddly but i kinda dont really know what i am talking about. second, do you need to tell scar where to search for the bitmap, or can you tell it to search anywhere (i want scar to click on it if it sees it anywhere).
     
  10. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    as far as i know you can only see bitmaps if they are on the visable part of the screen but that is no problem
    also with scar if you tell it to look for a bitmap it will look in all of the space in the selected client (the thing you dragged over with the cross hair)
    hope this helps and if you want me to explain even more just ask
     
  11. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    can you have it save the bitmaps location to a variable?
     
  12. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    ya i ll give you an example
    here are your variables
    Code (Text):
    1. junky, x, y: integer;
    here is what you put in your procedure
    Code (Text):
    1. junky:= BitmapFromString(bitmap stuff);
    2. if(findbitmap(junky,x,y))then
    3. clickmouse(x,y,true);
    does that make it clearer?
     
  13. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    how would you have it just say how may times a bitmap appears. I am making a true neofriends.net auth to looney toon's script and I was going to use that
     
  14. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    ok either i dont understand what your saying or i am not asking the right question. here is what i understood from what you said.
    Code (Text):
    1. var junky: integer;
    2.  
    3. junky= BitmapFromString(123456789);
    4. if(findbitmap(junky(
    and thats where you lost me. because i wanted to tell the general location of the bitmap, not tell it the location. would that look something more like this?
    Code (Text):
    1. var junky: integer;
    2. var random: string;
    3.  
    4. junky= BitmapFromString(123456789);
    5. if(FindBitmapIn(junky, x1*corner 1 of window*, y1*corner 2 of window*, x2*corner 3*, y2 *corner 4*)) then
    6. clickmouse(x,y)
    wow, that gave me a head ache
     
  15. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    I think so this i strait from SCAR help
    Looks right to me
     
  16. Anonymous

    Anonymous Guest

    I'll walk you through it:

    Code (Text):
    1. junky, x, y: integer;
    This is the name of the bitmap, and it's cords.

    Code (Text):
    1. junky:= BitmapFromString(bitmap stuff);
    This is the bitmap info.

    Code (Text):
    1. if(findbitmap(junky ,x,y))then
    this searches the page for the bitmap. If it finds it, the bitmap's cords = x, y

    Code (Text):
    1. Writeln(inttostr(x)+' '+inttostr(y));
    This puts the REAL cords into the reportbox (writeln)

    That help?
     
  17. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    I think find bitmap finds the bitmap at a certain pre determined co ord
     
  18. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    thats what i thought too. ok i have officially given myself a super bad headache. ok i want to tell my program to get a color at a certain place(since the bitmaps were giving me a migraine). i have this much so far
    Code (Text):
    1. program New;
    2. var var1: boolean;
    3. Procedure procedure1;
    4. begin
    5. Case _______ of
    6.  
    ok so how so i tell it to look in a certain place for a color?
     
  19. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    you do it with this
    Code (Text):
    1. getcolor(x,y)
    gets you the color from a certain chord
    Code (Text):
    1. findcolor(x,y,(color),x1,y1,x2,y2)
    lets you search for a certain color in a box and then it tell you where it has found it
     
  20. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    yeah, i just figured that out and now that i did i feel kind stupid that i didnt before :oops: . if i am making a script for a game (you are probably gonna be able to guess which game it is, but i dont want anyone else to take the idea and make their own script) and i want to make it do more than one procedure at the same time and then repeat itself would this be a good code
    Code (Text):
    1. pro1
    2. pro2
    3. pro3
    4. pro4
    5. repeat;
    i was not sure where but i thought that if there was no semicolon it would be read as one line