Recent Changes - Search:


Users


Developers

edit SideBar

LuaScript

Users.LuaScript History

Hide minor edits - Show changes to markup

July 01, 2007, at 08:50 PM by 71.160.134.132 -
Changed lines 76-77 from:

Sets the pixel output buffer's width to width. All proceding plot commands will wrap around this buffer width.

to:

Sets the pixel output buffer's width to width. All proceeding plot commands will wrap around this buffer width.

June 27, 2007, at 08:28 AM by 71.160.134.132 -
Changed line 50 from:

'int hf:OR( number a, number b )\\

to:

int hf:OR( number a, number b )\\

Changed line 53 from:

'int hf:XOR( number a, number b )\\

to:

int hf:XOR( number a, number b )\\

Changed line 56 from:

'int hf:AND( number a, number b )\\

to:

int hf:AND( number a, number b )\\

Changed line 59 from:

'int hf:LSH( number a, number bits )\\

to:

int hf:LSH( number a, number bits )\\

Changed line 62 from:

'int hf:RSH( number a, number bits )\\

to:

int hf:RSH( number a, number bits )\\

June 27, 2007, at 08:27 AM by 71.160.134.132 -
Changed lines 78-86 from:

nil plotRGB8( number color, number x, number y )
Plot a single pixel at coordinates x, y in the pixel output buffer, of color color. Pixel color is defined as 3 bytes packed within an unsigned number, in the format 0x00RRGGBB. If x is greater or equal to the width set with plotWidth, it will be clamped to plotWidth-1.
Example: plotWidth( 0xFF0000, 15, 15 ); -- Plot red pixel at 15,15

nil plotRGB8( number color )
Plot a single pixel at the next raster position in the pixel output buffer, of color color. Pixel coordinate is defined as 0,0 if no plotting has taken place, or one pixel to the right of the previously plotted pixel. Pixels that wrap over the right edge of the buffer loop down to the left of the next row.

to:

nil plotRGB8( number color [, number x, number y] )
Plot a single pixel at coordinates x, y in the pixel output buffer, of color color. Pixel color is defined as 3 bytes packed within an unsigned number, in the format 0x00RRGGBB. If x is greater or equal to the width set with plotWidth, it will be clamped to plotWidth-1. If x and y are not specified, pixel coordinate is defined as 0,0 if no plotting has taken place, or one pixel to the right of the previously plotted pixel. Pixels that wrap over the right edge of the buffer loop down to the left of the next row.
Example: plotWidth( 0xFF0000, 15, 15 ); -- Plot red pixel at 15,15
Example: plotWidth( 0x0000BB ); -- Plot blue pixel at next pixel raster position

June 27, 2007, at 08:24 AM by 71.160.134.132 -
Added lines 3-6:

Important Gotcha: Due to technical limitations, all functions that return boolean must be checked explicitly against the value 1.
Invalid: if hf:hasInt( 64 ) then
Valid: if hf:hasInt( 64 ) == 1 then

Added line 8:

Deleted lines 13-16:

Important Gotcha: Due to technical limitations, all functions that return boolean must be checked explicitly against the value 1.
Invalid: if hf:hasInt( 64 ) then
Valid: if hf:hasInt( 64 ) == 1 then

Added line 15:

Added line 21:

Changed line 35 from:
to:

Added lines 48-64:

Data Manipulation Functions


'int hf:OR( number a, number b )
Returns a bitwise OR between a and b (a | b)

'int hf:XOR( number a, number b )
Returns a bitwise XOR between a and b (a ^ b)

'int hf:AND( number a, number b )
Returns a bitwise AND between a and b (a & b)

'int hf:LSH( number a, number bits )
Returns a bitwise-shifted left bits bits (a << bits)

'int hf:RSH( number a, number bits )
Returns a bitwise-shifted right bits bits (a >> bits)

Added line 66:

Added line 73:

June 27, 2007, at 08:02 AM by 71.160.134.132 -
Changed line 4 from:
to:
June 27, 2007, at 08:02 AM by 71.160.134.132 -
Added lines 3-6:

LuaScript examples

LuaScript PCX Loader
Relatively complex PCX image loader example

June 26, 2007, at 10:06 AM by 71.160.134.132 -
Changed lines 42-43 from:

nil hf:print( string, ... )
Output a string of text, optionally formatted with printf-style flags. For more information, view the Lua manual's section on Lua string operations\\

to:

nil hf:print( string )
Output a string of text, optionally formatted with printf-style flags. For more information, view the Lua manual's section on Lua string operations\\

Changed lines 45-46 from:

Example: hf:print( "32-bit Unsigned Integer: 0x%d\n", hf:getUInt(32) );

to:

Example: hf:print( ("32-bit Unsigned Integer: 0x%d (1+1=0x%0x)\n"):format( hf:getUInt(32), 2 ) );

June 26, 2007, at 08:52 AM by 71.160.134.132 -
Changed line 5 from:

Important Gotcha: Due to technical limitations, all functions that return boolean must be checked explicitly against the value 1.\\

to:

Important Gotcha: Due to technical limitations, all functions that return boolean must be checked explicitly against the value 1.\\

June 26, 2007, at 08:51 AM by 71.160.134.132 -
Changed line 6 from:

Invalid: if hf:hasInt( 64 ) then

to:

Invalid: if hf:hasInt( 64 ) then\\

June 26, 2007, at 08:51 AM by 71.160.134.132 -
Added lines 5-8:

Important Gotcha: Due to technical limitations, all functions that return boolean must be checked explicitly against the value 1.
Invalid: if hf:hasInt( 64 ) then Valid: if hf:hasInt( 64 ) == 1 then

June 26, 2007, at 08:45 AM by 71.160.134.132 -
Added lines 23-24:

Data Traversal Functions

June 26, 2007, at 08:45 AM by 71.160.134.132 -
Added lines 26-34:

boolean hf:hasInt( number bits )
Returns true if there is enough data to read another integer of size bits.

boolean hf:hasFloat()
Returns true if there is enough data to read another 4-byte float number.

boolean hf:hasDouble()
Returns true if there is enough data to read another 8-byte double number.

June 26, 2007, at 08:38 AM by 71.160.134.132 -
Added lines 3-4:

See the Lua Manual for information on general Lua scripting. All core Lua libraries are enabled in Hex Fiend.

Changed lines 6-7 from:

""nil setLittleEndian( bool littleEndian )"" "defaults to little endian"

to:

nil setLittleEndian( bool littleEndian )
defaults to little endian\\

Changed lines 11-25 from:

""number hf:getUInt( integer bits )"" Returns an unsigned integer from up to the next 64 bits.

""number hf:getSInt( integer bits )"" Returns a signed integer from up to the next 64 bits.

""number hf:getFloat()"" "operates on 4 bytes"

""number hf:getDouble()"" "operates on 8 bytes"

""nil hf:skip( integer bits )"" Move the LuaScript cursor ahead by "bits" bits.

to:

number hf:getUInt( number bits )
Returns an unsigned number from up to the next 64 bits.

number hf:getSInt( number bits )
Returns a signed number from up to the next 64 bits.

number hf:getFloat()
operates on 4 bytes

number hf:getDouble()
operates on 8 bytes

nil hf:skip( number bits )
Move the LuaScript cursor ahead by bits bits.

Changed lines 27-28 from:

""nil hf:print( string, ... )""

to:

nil hf:print( string, ... )
Output a string of text, optionally formatted with printf-style flags. For more information, view the Lua manual's section on Lua string operations
Example: hf:print( "Hello world!\n" );
Example: hf:print( "32-bit Unsigned Integer: 0x%d\n", hf:getUInt(32) );

Changed lines 33-45 from:

""nil plotWidth( integer width )"" "defaults to 64" Sets the pixel output buffer's width to "width". All proceding plot commands will wrap around this buffer width.

""nil plotRGB8( integer color, integer x, integer y )"" Plot a single pixel at coordinates "x", "y" in the pixel output buffer, of color "color". Pixel color is defined as 3 bytes packed within an unsigned integer, in the format 0x00RRGGBB. If "x" is greater or equal to the width set with "plotWidth", it will be clamped to plotWidth-1. ""Example:"" plotWidth( 0xFF0000, 15, 15 ); -- Plot red pixel at 15,15

""nil plotRGB8( integer color )"" Plot a single pixel at the next raster position in the pixel output buffer, of color "color". Pixel coordinate is defined as 0,0 if no plotting has taken place, or one pixel to the right of the previously plotted pixel. Pixels that wrap over the right edge of the buffer loop down to the left of the next row.

to:

nil plotWidth( number width )
defaults to 64
Sets the pixel output buffer's width to width. All proceding plot commands will wrap around this buffer width.

nil plotRGB8( number color, number x, number y )
Plot a single pixel at coordinates x, y in the pixel output buffer, of color color. Pixel color is defined as 3 bytes packed within an unsigned number, in the format 0x00RRGGBB. If x is greater or equal to the width set with plotWidth, it will be clamped to plotWidth-1.
Example: plotWidth( 0xFF0000, 15, 15 ); -- Plot red pixel at 15,15

nil plotRGB8( number color )
Plot a single pixel at the next raster position in the pixel output buffer, of color color. Pixel coordinate is defined as 0,0 if no plotting has taken place, or one pixel to the right of the previously plotted pixel. Pixels that wrap over the right edge of the buffer loop down to the left of the next row.

June 26, 2007, at 08:25 AM by 71.160.134.132 -
Changed lines 1-40 from:

Coming soon...

to:

Each LuaScript operates on the range of data selected in the current document. As soon as a byte of data is read, execution moves to the next segment of data. The script automatically stops running when all selected data has been processed.

Script State Functions

""nil setLittleEndian( bool littleEndian )"" "defaults to little endian" All data processing functions proceding this call will treat bytes as Little Endian or Big Endian.

Data Processing Functions

""number hf:getUInt( integer bits )"" Returns an unsigned integer from up to the next 64 bits.

""number hf:getSInt( integer bits )"" Returns a signed integer from up to the next 64 bits.

""number hf:getFloat()"" "operates on 4 bytes"

""number hf:getDouble()"" "operates on 8 bytes"

""nil hf:skip( integer bits )"" Move the LuaScript cursor ahead by "bits" bits.

Text Output Functions

""nil hf:print( string, ... )""

Image Output Functions

""nil plotWidth( integer width )"" "defaults to 64" Sets the pixel output buffer's width to "width". All proceding plot commands will wrap around this buffer width.

""nil plotRGB8( integer color, integer x, integer y )"" Plot a single pixel at coordinates "x", "y" in the pixel output buffer, of color "color". Pixel color is defined as 3 bytes packed within an unsigned integer, in the format 0x00RRGGBB. If "x" is greater or equal to the width set with "plotWidth", it will be clamped to plotWidth-1. ""Example:"" plotWidth( 0xFF0000, 15, 15 ); -- Plot red pixel at 15,15

""nil plotRGB8( integer color )"" Plot a single pixel at the next raster position in the pixel output buffer, of color "color". Pixel coordinate is defined as 0,0 if no plotting has taken place, or one pixel to the right of the previously plotted pixel. Pixels that wrap over the right edge of the buffer loop down to the left of the next row.

June 26, 2007, at 03:03 AM by 71.160.134.132 -
Added line 1:

Coming soon...

Edit - History - Print - Recent Changes - Search
Page last modified on July 01, 2007, at 08:50 PM