Repeat Loops script?

Materials, references, tutorials

Moderators: Murderator+, Murderator

Post Reply
fantasticpow
Posts: 6
Joined: 2008-07-25 07:57:51

Repeat Loops script?

Post by fantasticpow »

How do I make the script repeat itself, so I don't have to press short cut key to have it run everytime.

I tried putting repeat in the script, but when I run the script, it stops. I want it to keep running for a macro.
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

Code: Select all

sub main()
repeat
    uo.print( "Hello world!" )
    wait( 1000 )
until false
endsub
if i correctly understand...
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
fantasticpow
Posts: 6
Joined: 2008-07-25 07:57:51

Post by fantasticpow »

Here is a code I'm trying to repeat. It only run once.

Code: Select all

sub Lootgold()
repeat
var i, n, box, tempname  
Dim A[24] 
A[1] = 0x0EED ;Gold Coins 
A[2] = 0x0F85 ;Ginsengs
i = 2 
box = 0x43EFAEAB
FOR n=1 TO 2 
  uo.findtype(A[n],"-1","lastcontainer")  
  if (uo.findcount()>0) and (uo.getdistance("lastcontainer")<4)then  
    UO.grab(0,"finditem") 
    tempname = UO.GetName( 'finditem' ) 
    Uo.moveitem("finditem","0","box") 
    uo.print("Looted "+str(tempname)) 
  else 
    UO.print("Nothing there for loot") 
  end if  
Wait(1000) 
NEXT  
end sub
Scripts Writer
Posts: 2259
Joined: 2005-04-19 18:00:29
Location: Московская область
Contact:

Post by Scripts Writer »

Code: Select all

FOR n=1 TO 2 

NEXT 
This is not repeat construction
fantasticpow
Posts: 6
Joined: 2008-07-25 07:57:51

Post by fantasticpow »

so do I delete the line
For n
and take out the line
Next
Post Reply