Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- By Rami4444 -- Email : ramilego4game@gmail.com --
- -- options --
- local CloseAfterSet = true
- -------------
- local Ver = "1" --define the version
- local CCM = Window:new(-1,-1,200,200) --creates a new window
- local FTL = Label:new(10,10,80,16, "Current mode :") --create a new text label
- local STL = Label:new(10,60,60,16, "Element :") --create a new text label
- local TTL = Label:new(10,100,60,16, "Change to :") --create a new text label
- local FOTL = Label:new(135,40,60,16, ("CCM V"..Ver)) --create a new text label
- -- Close button
- local closeButton = Button:new(10, 174, 60, 16, "Close") --creates close button
- closeButton:action(function() interface.closeWindow(CCM) end) --set the function to call after clicking close button
- CCM:onTryExit(function() interface.closeWindow(CCM) end) -- Allow the default exit events
- CCM:addComponent(closeButton); --add the close button to the window
- --local ccmButton = Button:new(1, 1, 15, 15, "T", "Open Command Cheat Menu") --Set The Button In The Up Right Corner.
- local ccmButton = Button:new(613, 97, 15, 15, "T", "Open Command Cheat Menu") --Set The Button In The Up Right Corner.
- --local ccmButton = Button:new(613, 113, 15, 15, "T", "Open Command Cheat Menu") --Set The Button Under Restart Button.
- ccmButton:action(function() interface.showWindow(CCM) end)--set the function to call after clicking T button
- local modeButton = Button:new(130,10,60,16, "Type", "Change The Mode")--adds mode Button
- local curMode = modeButton:text(); --get the text of the button (Mode)
- function changeMode() --creats changeMode function
- curMode = modeButton:text(); --update the current mode
- if curMode=="Type" then --checks if the current mode is "Type"
- modeButton:text("Temp")--Change to Temp mode
- TTL:text("Set temp to :")--Set the Text Lebel "TTL"
- end
- if curMode=="Temp" then --checks if the current mode is "Temp"
- modeButton:text("Type")--Change to Type mode
- TTL:text("Change to :")--Set the Text Lebel "TTL"
- end
- end
- modeButton:action(function() changeMode() end) --set the function to call after clicking mode button
- ftxt = Textbox:new(10, 80, 180, 16)--adds Textbox
- stxt = Textbox:new(10, 120, 180, 16)--adds Textbox
- setButton = Button:new(130,174,60,16, "Set")--adds Textbox
- function setMode()--creates setMode function
- curMode = modeButton:text();--update the current mode
- if curMode=="Type" then
- --print (curMode)--used for debugging
- typeMode()--do the typeMode function
- end
- if curMode=="Temp" then
- --print (curMode)--used for debugging
- tempMode()--do the tempMode function
- end
- if CloseAfterSet then --checks if user need to close after set
- interface.closeWindow(CCM) --close window
- end
- end
- function typeMode()--creates typeMode function
- --print (curMode)--used for debugging
- ftext = ftxt:text()-- checks for "ftxt" text
- stext = stxt:text()-- checks for "stxt" text
- if ftext=="" then-- used to fix don't close by pressing set when there is no think in the spaces
- ftext = "metl"
- stext = "metl"
- end
- tpt.set_property("type", stext, ftext) --set the type
- end
- function tempMode()--creates tempMode function
- --print (curMode)--used for debugging
- ftext = ftxt:text()-- checks for "ftxt" text
- stext = stxt:text()-- checks for "stxt" text
- if ftext=="" then-- used to fix don't close by pressing set when there is no think in the spaces
- ftext = "metl"
- stext = "0"
- else
- tpt.set_property("temp", stext, ttext) --set the temp
- end
- end
- setButton:action(function() setMode() end) --set the function to call after clicking set button
- CCM:addComponent(modeButton)--adds modeButton to the window
- CCM:addComponent(ftxt)--adds ftxt to the window
- CCM:addComponent(stxt)--adds stxt to the window
- CCM:addComponent(setButton)--adds setButton to the window
- CCM:addComponent(FTL)--adds FTL to the window
- CCM:addComponent(STL)--adds STL to the window
- CCM:addComponent(TTL)--adds TTL to the window
- CCM:addComponent(FOTL)--adds FOTL to the window
- interface.addComponent(ccmButton)--adds menu button to PowderToy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement