DSLua Community

DSLua - Best scripting language for Nintendo DS => Examples/Tutorials => Topic started by: sylus101 on May 13, 2007, 01:35:19 PM



Title: ACTools, scripts for your scripts
Post by: sylus101 on May 13, 2007, 01:35:19 PM
Hi Folks,

 http://www.actool.net (http://www.actool.net)

      ACTools is another scripting program that can control simple Windows commands. It moves the mouse to certain positions, enters keystrokes and can do several other helpful things. I've used it to mass modify file names, run an entire automated bot that sells Magic The Gathering Online cards, and most recently... write a few scripts for my DSLua game.

     There was a post in the Help section on how to turn the whole screen white without using backgrounds. Obviously you'd have to use sprites for it, but it takes forever to write up all those sprites. ACTools can easily type out repetitive actions like this, increment variables along the way, etc.

     Here's an example of an ACTool script I wrote to fill the screen with a 32 x 16 (need to save memory, didn't want to use 64 X 64) Sprite over and over. You start the script, click into your LUA editor and watch it go. I have similar scripts (it's easy just to modify this one) to SetFrame and Free(). In this case, the FrameStrip fadeframe has already been defined. The only problem is remembering the differences between the two, like "loop 30" in ACTools would be "for h=1,30 do" in LUA.

The other thing I do with this is copy and paste my LUA script into ACTools, and it has a little Beautify function that spaces everything out for you nicely. You just have to replace all for's with loop's first (and not forget to switch them back). Does anyone use a good editor that can pull this off with direct LUA Scripts?

Code:
constants
 
  number = 1
  xc = 0
  yc = 0
 
end

delay 2 sec

loop 12
 
  loop 8
   
    keys fade
    keys $number
    keys {space}
    keys = Sprite.Create(fadeframe,0,4,$xc,$yc)
    keys {return}
    inc number
    loop 32
      inc xc
    end
  end
 
  setconst xc = 0
  loop 16
    inc yc
  end
end


Title: Re: ACTools, scripts for your scripts
Post by: manu62300 on May 13, 2007, 05:34:38 PM
Good Job perfectly ;)