Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local param = ...
- dofile("bs/apis/wrapper")
- --initialization
- local args = bs.params.load("bs/files/furnace_sender_params")
- local hook = bs.rdnt.hook:new()
- hook.port = args.port
- hook.socketID = args.socketID
- hook:connect(1)
- if param == "connect" then
- args.socketID = nil
- end
- --methods and classes
- local function setParams()
- local stable = {}
- ui.clear()
- stable.port = ui.getInput("Which name should this connection have?")
- ui.clear()
- stable.count = ui.getInput("How many furnaces are setup?", true)
- ui.clear()
- hook:request("setParams", stable)
- args.port = stable.port
- args.socketID = hook.socketID
- hook.port = stable.port
- bs.params.save("bs/files/furnace_sender_params", args)
- end
- --program start
- if args.socketID == nil or args.port == nil then
- hook.port = "autofurnace"
- hook:connect()
- setParams()
- end
- while true do
- local _, returns = hook:request("test", ui.getInput("a test string: "))
- ui.clear()
- print(returns.."\n")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement