Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   A (More) Readable Script (http://www.chiefdelphi.com/forums/showthread.php?t=32798)

Astronouth7303 14-01-2005 21:18

A (More) Readable Script
 
1 Attachment(s)
I've revised the scripting setup slightly so that the written scripts are slightly more readable (not what I eventually want, but better.)

Here's the default script rewritten in this format:
Code:

BEGIN_SCRIPT(command_list)
  GYRO_BIAS
  WAIT_FOR_BUMP
  WAIT(1000)
  DRIVE(1500)
  WAIT(4000)
  TURN(-1500), 50)
  WAIT(3000)
  DRIVE(2400)
  WAIT(4000)
  TURN((PI_MRAD / 2), 50)
  WAIT(4000)
  DRIVE(2400)
  WAIT(4000)
  TURN((-1500), 50)
  WAIT(1000)
  DRIVE(0)
  KEEP_HEADING(240000, 100)
  JUMP(1)
END_SCRIPT

The argument to BEGIN_SCRIPT is the name of the script in code (must be "command_list" unless you modify robot.c ;) )

I've attached the required header, and have posted it (or will if not already) to frcoder.

[edit]A few of the commands in the header are not in the default code. If you use them, it won't compile.[/edit]

[edit=2]The header and more usage notes are now at frcoder. I wrote this file entirely, so it is under LGPL like the rest of the site.[/edit]

Ryan M. 15-01-2005 18:27

Re: A (More) Readable Script
 
Very nice! :)

I may actually use this now. ;)

DanDon 15-01-2005 20:26

Re: A (More) Readable Script
 
Thank you very much, I was going to do this, but my fellow programmer (glares) put me off of it. Now he doesn't have an excuse :).

Thanks again,

Dan


All times are GMT -5. The time now is 02:47.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi