Tool: Stop Or Edit

I have made my first (and very simple but useful) tool, and thought some experienced coder could just see that it’s OK before i release it. It works but maybe it’s too ugly?

-- My first simple script, making a keyboard shortcut working like Milkytrackers spacebar. It stops if playing, and toggles editmode if stopped.  
function stop_or_edit()  
 if == true then  
 elseif not then = true  
 else = false  
renoise.tool():add_keybinding {  
name = "Pattern Editor:Play:Stop or Edit",  
invoke = function() stop_or_edit() end  

Looks good to me. You dont really need the == true in the first if statement, but maybe you already knew that.

Looks good, and don’t want to discourage you, but there is an option in Renoise to get the old FTII space key behavior: -> Space rec/stop mode

Thanks taktik, I will use this feature instead.

I am already working on a new and more serious tool. Even for non-coders it’s quite easy to just copy+paste from the API reference :)