Problem with my first script

Discussion in 'Code Snippets and Tutorials' started by zippy, Feb 24, 2007.

  1. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    I'm trying to make a script which plays dice escape and get the avatar, i just coded the first level, but the dice just move 1 time and the script finish, and in the script i have the up key 5 times, why this happens?
     
  2. test123

    test123 Level IV

    Joined:
    Nov 3, 2006
    Messages:
    935
    Likes Received:
    0
    Location:
    Australia
    hey

    perhaps your wait times are too quick?
     
  3. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    Hmmm i will try o.o
     
  4. looneytoon

    looneytoon Level III

    Joined:
    Jan 16, 2007
    Messages:
    568
    Likes Received:
    0
    yeah it may be too quick, and make sure you have a repeat call in there, sounds like you dont have one in there
     
  5. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    no i dont have, but is fixed, now it do what i want, thx :D
     
  6. looneytoon

    looneytoon Level III

    Joined:
    Jan 16, 2007
    Messages:
    568
    Likes Received:
    0
    how did you fix it? did you use my suggestion?
     
  7. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    umm no, the test123 suggestion

    But my new problem is that i want to make it click, but the mouse just move to the coordinates and dont click x.x
     
  8. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    to click the mouse use
    Code (Text):
    1. clickmouse(x,y,true);
    to move the mouse without clicking use
    Code (Text):
    1. movemousesmooth(x,y,true);
     
  9. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    yes. my code is this:

    clickmouse(152,293,true);

    but it dont click, just move o.o
     
  10. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    that's really strange
    why not try
    Code (Text):
    1. movemousesmooth(152,293,true);
    2. clickmouse(152,293,true);
    3.  
    and see if that works
     
  11. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    i tried and got this

    Line 5: [Error] (5:30): Invalid number of parameters in script

    but the paramers are right :s
     
  12. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    i got that as well
    i m going to bed but i ll have a look into that tomorow and in the meantime good luck

    EDIT: ok you need scar but this works
    Code (Text):
    1.  
    2. program New;
    3. {.include SRL/SRL.scar}
    4. begin
    5. MMouse(x,y,0,0);
    6. end.
    7.  
     
  13. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    i changed the instructions on it so it will not need to click, or maybe at the end to send score o.o

    anyway, with the help here now i have programmed to level 4, i will end later :)
     
  14. test123

    test123 Level IV

    Joined:
    Nov 3, 2006
    Messages:
    935
    Likes Received:
    0
    Location:
    Australia
    hey

    try clicking twice with a wait of a second inbetween
     
  15. Smelly

    Smelly Level IV

    Joined:
    Dec 1, 2006
    Messages:
    2,197
    Likes Received:
    8
    Location:
    England
    i tried to code dice escape a couple of weeks ago, but there must be something about shockwave and my pc, because everytime i coded an arrow key, it didnt work properly.

    hmm

    good luck with yours though
     
  16. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    Re: hey

    Already tried
     
  17. test123

    test123 Level IV

    Joined:
    Nov 3, 2006
    Messages:
    935
    Likes Received:
    0
    Location:
    Australia
    hey

    ah...i think its because its a shockwave game
     
  18. zippy

    zippy Level IV

    Joined:
    Nov 9, 2006
    Messages:
    879
    Likes Received:
    0
    Re: hey

    i solved it with the hold button feature n.n