View topic - lua console v.04a



All times are UTC + 1 hour


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: lua console v.04a
PostPosted: 07 Jan 2011, 03:51 
User avatar

Joined: 21 Oct 2005, 22:46
Location: Florida
something i whipped up, it's functional but some bugs that i'm still working on..

it's very simple now, so all it's capable of is single line calls, eg. Spring.GetSelectedUnits(), etc...

Code:
press Ctrl to activate, then simply start typing a command.
Enter to enter...
Ctrl again to deactivate


download here: http://www.springfiles.com/show_file.php?id=2902


Things to work on:
- working on implementing a different mode to be able to type more than a single line of code
- implement a better gui
- not all errors are printed


criticism, suggestions, and bug reports welcome


Last edited by Alchemist on 07 Jan 2011, 05:47, edited 1 time in total.

Top
 Offline Profile  
 
 Post subject: Re: lua console v.04a
PostPosted: 07 Jan 2011, 05:04 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
interessting. (but too lazy to test right now)
you could make into a debug tool thing, like printing unitIDs above units could be usefull for DestroyUnit (u) etc


Top
 Offline Profile  
 
 Post subject: Re: lua console v.04a
PostPosted: 07 Jan 2011, 13:54 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
knorke wrote:
printing unitIDs above units
Code:
function widget:GetInfo()
    return {
            name    = "Show Unit ID",
            desc    = "Show all ID of all units",
            author    = "zwzsg",
            date    = "August 2010",
            license    = "Free",
            layer    = 0,
            enabled    = false,
        }
end


function widget:DrawScreenEffects()
    for _,id in ipairs(Spring.GetAllUnits()) do
        local x,y=Spring.WorldToScreenCoords(Spring.GetUnitPosition(id))
        gl.Text("ID:"..id,x,y,16,"od")
    end
end


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Jools and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.