how can i ..

Discussion in 'Code Snippets and Tutorials' started by zippy, Mar 14, 2007.

  1. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    going to make my 5º program yay...

    ok, is there any code to the script keep doing something until it find a bitmap?

    i mean, a refresher that the script refresh, and refresh, and refresh more... and stop until it find CERTAIN random event (no any random, one specific)
     
  2. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    ya you can use something like this (note not actual code just what you have to do)
    Code (Text):
    1.  
    2. repeat
    3. (press key f5)
    4. (a procedure which when)findbitmap(xxxxxxxxxxxxxxx)then
    5. (press keys ctrl, alt and s)
    6.  
    sprry i couldn't give you exact code as i don't have much time but that is how you do it and i think you are a good enough scripter to do it from there
     
  3. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    is not a code like
    "repeat

    what to repeat

    until(findbitmap)(bitmaphere)?"
     
  4. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    that would work as well
     
  5. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    oh i dont understand D:

    can you give me a better example? :p
     
  6. zav75

    zav75 Level I

    Joined:
    Feb 28, 2007
    Messages:
    76
    Likes Received:
    6
    Location:
    Canada, Province of Québec
    I see, maybe my code example could help you.

    Code (Text):
    1. //author  : put your name here <-
    2. //How to use : 1- select, with crosshair, the client window
    3. //             2- press on the cute green arrow above
    4. //             3- take a walk, have sex, cigarette, coffee,learn scar, etc.
    5. //             4- stop the script, with sexy the red sqarre
    6. //
    7. //How to edit: 1- take bitmap of your random even
    8. //             2- Script/Picture to String...
    9. //             3- replace evenBitmap by your specific even bitmap
    10. //             4- put your name after author
    11. //             5- give rep point to zav (just kidding)
    12. //             6- return to step 5 or second option of the 3rd step of  "How to
    13. //                use"  explainations
    14.  
    15.  
    16.                
    17. program EvenFinderV4234;
    18.  
    19. var
    20. x,y, evenBitmap,randomEvenCpt :integer ;
    21.  
    22. procedure refresherF5;
    23. begin
    24. KeyDown(116);   //press F5
    25. wait(15+random(5));
    26. KeyUp(116);    //release F5
    27. wait(1000+random(8000)) //time to load new page
    28. end; //end of procedure
    29.  
    30. procedure findEven;
    31. begin
    32.        evenBitmap := BitmapFromString(80, 12, 'z78DAED97310' +
    33.        'E80300845AFE462E2AA49EF7F25579326E4237C444A0786569A4F' +
    34.        '5F013BCE715CFB68DB7661BB3D06DB2B329679ACC9AE065F594F5' +
    35.        '5CA3CBEFF8A145F45B27E5E95BDF04A822B79F725AEC7773744B3' +
    36.        'D697772B2C34B5F3162F869EC8E81899C856FB2D5FFBCEF127A62' +
    37.        '59E9FAFA5F656E59B276B789998E1649A6FD767AF6EEEF5FE8DE9' +
    38.        'DA8C3FF9F81EE41B5DEDD76B5B99EF0DF89225F4');
    39.  
    40.  
    41.        while( not FindBitmap( evenBitmap, x,y) )  do   //while even not found
    42.        begin
    43.            refresherF5 ;          //refresh
    44.        end;
    45. Writeln('Even found! omg weeeee!');
    46. randomEvenCpt:= randomEvenCpt+1 ;
    47. SaveScreenshot( 'Even'+ inttostr(randomEvenCpt) )  //save screenshot of
    48.                                                    //of  the even
    49. end;  //end of procedure
    50.  
    51. begin   //start of the main program
    52. randomEvenCpt:=0 ;
    53.          while( true ) do
    54.          begin
    55.                findEven;
    56.          end;  //end of while
    57.  
    58. end.  //end of program
    thx Marlene for rep!!! <3
     
  7. marlene

    marlene Moderator
    Staff Member

    Joined:
    Dec 23, 2006
    Messages:
    1,492
    Likes Received:
    12
    Location:
    Somewhere under the Rainbow (Montreal)
    Nice code example and I especially liked the instructions.

    +rep
     
  8. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    nice code example, if my script works i will credit you =P

    +rep anyway
     
  9. zav75

    zav75 Level I

    Joined:
    Feb 28, 2007
    Messages:
    76
    Likes Received:
    6
    Location:
    Canada, Province of Québec
    Actuall, it already works, found 4 codestones yesterday, but my bitmap I took is not good, I took the bitmap on a random webpage. If you have a random even screenshot it !!! and send it to me :D. This way the script will register the evens. (I know for the codetones because they're in my inventory, also found some random shits like icecream )

    oh also thx for rep :D