local g = peripheral.wrap("right")
local lg = peripheral.wrap("left")
local e, msg = os.pullEvent("chat_command")
if string.match(msg, "request") then
print("Requesting")
end
11 replies to this topic
#1
Posted 19 June 2014 - 12:46 AM
I am trying to make a system where I can remote request items via the OpenPeripheral Terminal Glasses, by pulling items through a Logistics Pipes' Request Pipe. I would like the syntax of the command to be "$$request id dmg amount" but I can't figure out how to get arguments to work with the glasses. This is what I have so far for testing:
#3
Posted 19 June 2014 - 12:12 PM
Ok, I will try that out.
#4
Posted 19 June 2014 - 12:44 PM
That solved that problem, thanks
#5
Posted 19 June 2014 - 03:14 PM
Ok, that works now, and the code now looks like the below after some work and additional lines for debug reasons:
But, it returns:
When I enter: $$request 1 0 4 through my Terminal Glasses.
I am using this website to get the methods for Logistics Pipes: http://rs485.thezorr...mputerCraft_API
local g = peripheral.wrap("right")
local lg = peripheral.wrap("left")
local e, msg = os.pullEvent("chat_command")
local id, dmg, amount = msg:match("request (%d+) (%d+) (%d+)")
local arg = {...}
if string.match(msg, "request") then
print("Requesting")
print(id)
print(dmg)
print(amount)
local requestedID = lg.getItemIdentifierIDFor(id, dmg)
print(requestedID)
local requestName = lg.getUnlocalizedName(requestedID)
print(requestName)
lg.makeRequest(requestedID, amount)
end
But, it returns:
Spoiler
When I enter: $$request 1 0 4 through my Terminal Glasses.
I am using this website to get the methods for Logistics Pipes: http://rs485.thezorr...mputerCraft_API
Edited by bladze420, 19 June 2014 - 03:15 PM.
#7
Posted 19 June 2014 - 03:44 PM
Ok, thanks
#8
Posted 19 June 2014 - 04:01 PM
I added the classes to the config now, but the program will not return anything when I enter $$request 1 0 4. It doesn't even register that I sent anything. The weird thing is, when I am typing this into the Lua interface directly, it works fine.
Edited by bladze420, 19 June 2014 - 04:01 PM.
#9
Posted 20 June 2014 - 05:32 AM
re-sync your terminal glasses to the glasses bridge. something may have caused them to be desynchronised.
#10
Posted 20 June 2014 - 05:54 PM
Ok, got it, but now it returns the same error as before.
Edited by bladze420, 20 June 2014 - 07:51 PM.
#11
Posted 21 June 2014 - 03:14 AM
then you've either got a version of OpenPeripheral where the blacklist was buggy (in which case update if you can) or you've not blocked logistics pipes correctly, so recheck the config (also perhaps try the mod id blacklist).
#12
Posted 24 June 2014 - 12:37 AM
What would I use for the mod blacklist?
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











