Jump to content

A little help plz.


supag
 Share

Recommended Posts

(96,6) : ERROR: syntax error

Do _myfunction

~~~^

(152,17) : WARNING: $i: possible used before declaration.

$i = $i +

~~~~~~~~~~~~~~~~^

(153,5) : ERROR: missing EndIf.

Until

~~~~^

(96,3) : REF: missing EndIf.

Do

^

- 2 error(s), 1 warning(s)

>Exit code: 0 Time: 44.616

Link to comment
Share on other sites

Take a look at this old script maybe it well help you. Take note of how I made all of the actions into functions and checked pixels to call the functions. There is more then one way to call functions. I made this before I knew you could just type the function name.

Opt ("MouseCoordMode",0)

do
Sleep(1500)

Select
Case PixelGetColor(446,62) = 16776960 and PixelGetColor(366,268) = 0
    MouseClick("left", 383, 314, 1,1)
Sleep(100)
MouseClick("left", 407, 325, 1,5)
Sleep(100)

case PixelGetColor (430,307) = 16777164; click ok for big treasure chest
        MouseClick ("left",430,307,1,1) 


Case PixelGetColor(659, 558) = 16040323
    call("_smokeMT")
        
    
    case PixelGetColor (338,465) = 13421670 and PixelGetColor (254,532) = 0; for dungeon only; for dungeon only
      call("_1")

case PixelGetColor (338,244) = 10066227
        MouseClick ("left",388,244,1,1) 
        
    case PixelGetColor (386,286) = 16578283 and PixelGetColor (684,400) = 10913038
        MouseClick("left",482,339,1,10)
        Sleep(4000)
        MouseClick("left",433,310,1,10)
    
    case PixelGetColor (338,465) = 13421670; for dungeon only
        MouseClick ("left",383,204,1,1) 
        
    case PixelGetColor (360,67) = 48895 and PixelGetColor ( 466,448) = 48383
        MouseClick ("left",379,404,1,1)  
    
    case PixelGetColor (723,221) =  9077135
        Call("_Undeadwar")
    
    case PixelGetColor (445,112) = 16180414 and PixelGetColor (574,424) = 15053312
        Call("_Undeadareana")
    
    case PixelGetColor (153,102) = 16764006 and PixelGetColor (324,266) = 16711680
        MouseClick ("left",259,321,1,1)

    Case PixelGetColor (419,485) = 16776960 and PixelGetColor (357,282) = 16777215
        MouseClick ("left",421,283,1,1)
        
    Case PixelGetColor (354,488) = 16777215 and PixelGetColor (357,282) = 16777215
        Call("_heal")
        
            
    Case PixelGetColor (323,203) = 26316 and PixelGetColor (526,181) = 26316
        MouseClick ("left",375,367,1,1)
    
    Case PixelGetColor (64,364) = 3381555 and PixelGetColor (270,388) = 10040064
        MouseClick ("left",350,311,1,1)
    
    Case PixelGetColor (167,214) = 16777062 and PixelGetColor (347,274) = 10027008
        MouseClick ("left",383,319,1,1)
    Case Else 
    
EndSelect
until PixelGetColor (167,214) = 26316 and PixelGetColor (270,388) = 10040065





 PixelGetColor(659, 558) = 16040323
Func _smokeMT()         
         MouseClick("left", 142, 369, 1, 1)
         Sleep(1500)
         MouseClick("left", 294, 431, 1)
         Sleep(1500)
         MouseClick("left", 369, 229, 1)
         Sleep(1500)
         MouseClick("left", 519, 212, 1)
         Sleep(3500)
         MouseClick("left", 396, 214, 1)
         Sleep(2500)
         MouseClick("left", 689, 476, 1)
         Sleep(1500)
         MouseClick("left", 550, 393, 1)
         Sleep(100)
         MouseClick("left", 539, 358, 1)
         Sleep(1500)
         MouseClick("left", 396, 209, 1)
         Sleep(1500)
         MouseClick("left", 679, 264, 1)
         Sleep(1500)
         MouseClick("left", 379, 219, 1)
         Sleep(1500)
         MouseClick("left", 492, 395, 1)
         Sleep(1500)
         MouseClick("left", 626, 148, 1)
         Sleep(1500)
EndFunc         
         
func _1()
      MouseClick("left",338,465,1,1)
        Sleep(2000)
MouseClick("left", 523, 194, 1)
Sleep(2000)
MouseClick("left", 388, 253, 1)
Sleep(2000)
MouseClick("left", 647, 474, 1)
Sleep(2000)
MouseClick("left", 535, 391, 1)
Sleep(2000)
MouseClick("left", 404, 193, 1)
Sleep(2000)
MouseClick("left", 290, 402, 1)
Sleep(2000)
MouseClick("left", 382, 230, 1)
Sleep(2000)
MouseClick("left", 680, 266, 1)
Sleep(2000)
MouseClick("left", 485, 325, 1)
Sleep(2000)
MouseClick("left", 380, 455, 1)
Sleep(2000)
MouseClick("left", 377, 430, 1)
Sleep(2000)
MouseClick("left", 377, 430, 1)
Sleep(2000)
MouseClick("left", 413, 230, 1)
Sleep(2000)
EndFunc


#region- Heal
Func _heal()

    
MouseClick("left", 372, 355, 1)
Sleep(100)
IF PixelGetColor (520,334) = 10027008 and PixelGetColor (512,335) = 10027008 and Not PixelGetColor (513,337) = 10027008    then
    call("_mana")
MouseClick("left", 403, 324, 1)
Sleep(100)
MouseClick("left", 503, 330, 1)
Sleep(100)
Else
MouseClick("left", 582, 344, 1)
Sleep(100)
EndIf
EndFunc

    
#region mana potion
Func _mana()
    if PixelGetColor (210,555) = 723723 then
    
    MouseClick("left", 373, 354, 1)
    Sleep(100)
    MouseClick("left", 576, 392, 1)
    Sleep(100)
EndIf
EndFunc
#endregion



#region --- ScriptWriter generated code Start --- 
Func _Undeadwar()
Opt("MouseCoordMode",0)
MouseMove(572,439,1)
MouseDown("left")
MouseUp("left")
Sleep(1500)
MouseMove(595,316)
MouseDown("left")
MouseUp("left")
Sleep(1500)
MouseMove(577,254)
MouseDown("left")
MouseUp("left")
Sleep(1500)
MouseMove(587,298)
MouseDown("left")
MouseUp("left")
Sleep(1500)
MouseMove(332,367)
MouseDown("left")
MouseUp("left")
Sleep(1500)

Endfunc
#endregion --- ScriptWriter generated code End --- 


#region --- ScriptWriter generated code Start --- 
Func _Undeadareana()
Opt("MouseCoordMode",0)
MouseMove(383,311,1)
MouseDown("left")
MouseUp("left")
;Sleep(21000)
;MouseMove(393,378)
;MouseDown("left")
;MouseUp("left")
;Sleep(21000)
;MouseMove(261,357)
;MouseDown("left")
;MouseUp("left")
;Sleep(21000)
;MouseMove(374,455)
;MouseDown("left")
;MouseUp("left")
;Sleep(21000)
;MouseMove(294,419)
;MouseDown("left")
;MouseUp("left")
;Sleep(9000)
;MouseMove(389,225)
;MouseDown("left")
;MouseUp("left")
;Sleep(9000)
;MouseMove(516,208)
;MouseDown("left")
;MouseUp("left")
;Sleep(9000)
;MouseMove(360,219)
;MouseDown("left")
;MouseMove(359,219)
;MouseUp("left")
;Sleep(9000)
;MouseMove(64,250)
;MouseDown("left")
;MouseUp("left")
;Sleep(9000)
;MouseMove(380,158)
;MouseDown("left")
;MouseUp("left")
;Sleep(9000)
;MouseMove(710,245)
;MouseDown("left")
;MouseMove(711,245)
;MouseUp("left")
;Sleep(9000)
;MouseMove(738,238)
;MouseDown("left")
;MouseUp("left")
;Sleep(9000)
;MouseMove(398,269)
;MouseDown("left")
;MouseUp("left")
;Sleep(9000)
;MouseMove(610,227)
;MouseDown("left")
;MouseUp("left")
;Sleep(9000)
;MouseMove(298,315)
;MouseDown("left")
;MouseUp("left")
;Sleep(4000)
EndFunc
#endregion --- ScriptWriter generated code End ---
Edited by quick_sliver007

.

Link to comment
Share on other sites

ohhh, thats what i need to do, i just dont know how. i will give it a shot tho, thanx. gonna try to use "case" and "func _blah". If i did break my script up into that stuff, how would i loop it?

Link to comment
Share on other sites

Func _myfunction()
Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE")

Sleep(5000)
WinSetState("Welcome to MSN.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE)
Sleep(800)
MouseClick("left", 190, 100, 2)

Send("http://myspace.com{ENTER}")
Sleep(10000)

MouseClick("left", 693, 340, 2)


Send("password{ENTER}")

Sleep(15000)


MouseClick("left", 365, 256, 2)
Sleep(9000)
MouseClick("left", 358, 328)
Sleep(800)
Send("{DOWN}")
Sleep(2000)
MouseClick("left", 461, 328)
MouseClick("left", 461, 328)
Sleep(800)
Send("{DOWN}")
Sleep(800)
MouseClick("left", 356, 363, 2)
Sleep(800)
MouseMove(340, 120)
Sleep(800)
Send("{ENTER}")
Sleep(2000)
MouseClick("left", 450, 363, 2)
Sleep(5000)
MouseClick("Left", 450, 400)
Sleep(1000)
Send("^f")
Sleep(500)
Send("View Profile{ENTER}")
Sleep(500)


Case    $Co_ord1 = PixelSearch(20, 500, 450, 710, 0x335EA8)
    MouseMove($Co_ord1[0], $Co_ord1[1], 0)
    MouseClick("Right")
    Sleep(500)
    Send("n")

Sleep(15000)

WinSetState("Myspace.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE)
Sleep(800)



Case    $Co_ord1 = PixelSearch(20, 500, 450, 700, 0x955127)
    MouseMove($Co_ord1[0], $Co_ord1[1], 0)
    MouseClick("Left")



Sleep(7000)

Case    $Co_ord1 = PixelSearch(120, 240, 380, 520, 0xE3EBF3)
    MouseMove($Co_ord1[0], $Co_ord1[1], 0)
    MouseClick("Left")


Sleep(7000)

WinClose("Myspace.com - Microsoft Internet Explorer")
Sleep(200)
EndFunc



While 1
Case WinActivate("Myspace.com - Microsoft Internet Explorer", "")
    If Not WinActive("Myspace.com - Microsoft Internet Explorer") Then 
        Do _myfunction()
        
    Case    Sleep(800)
        WinClose("Find")
        Sleep(800)
        Send("{PGUP}")
        Send("{PGUP}")
        Sleep(200)
        MouseClick("left", 450, 363, 2)
        Sleep(5000)
        MouseClick("Left", 450, 400)
        Sleep(1000)
        Send("^f")
        Sleep(500)
        Send("View Profile{ENTER}")
        Sleep(500)
        
        
    Case    $Co_ord1 = PixelSearch(20, 500, 450, 710, 0x335EA8)
            MouseMove($Co_ord1[0], $Co_ord1[1], 0)
            MouseClick("Right")
            Sleep(500)
            Send("n")
        
        Sleep(15000)
        
        WinSetState("Myspace.com - Microsoft Internet Explorer", "", @SW_MAXIMIZE)
        Sleep(800)
        
        
        
    Case    $Co_ord1 = PixelSearch(20, 500, 450, 700, 0x955127)
            MouseMove($Co_ord1[0], $Co_ord1[1], 0)
            MouseClick("Left")
        
        
        
        Sleep(7000)
        
    Case    $Co_ord1 = PixelSearch(120, 240, 380, 520, 0xE3EBF3)
            MouseMove($Co_ord1[0], $Co_ord1[1], 0)
            MouseClick("Left")
        
        
        Sleep(7000)
        
        WinClose("Myspace.com - Microsoft Internet Explorer")
        Sleep(200)
        
    WEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Like this? i got an error for

"Case $Co_ord1 = PixelSearch(20, 500, 450, 710, 0x335EA8)

MouseMove($Co_ord1[0], $Co_ord1[1], 0)

MouseClick("Right")

Sleep(500)

Send("n")"

how else can i write that?

Link to comment
Share on other sites

ohhh, thats what i need to do, i just dont know how. i will give it a shot tho, thanx. gonna try to use "case" and "func _blah". If i did break my script up into that stuff, how would i loop it?

<{POST_SNAPBACK}>

look at the
D0;;;;;;;this is a loop
   Select;;;;;;;;;This a statement inside the do loop that picks an action base on case statements
           Case something = something
            actions to do, when actions are finished it looks for the case that is true
           
          Case something = something
            actions to do, when actions are finished it looks for the case that is true
    EndSelect
until;;;;;;do until something. well repeat the select case statement until loop is ended

.

Link to comment
Share on other sites

I only want line 82 and done to loop, but Winactive checks to make sure the window is up, if not then i want it to start over from the beginning

<{POST_SNAPBACK}>

I been looking at the script in detail just now and I think I can get it right. Let me get on Aim, because I need you to get some info. My Aim name is lllegaljsl

.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...