This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Aron1973's profile picture

Weard error

Started by Aron1973, 28 February 2014 - 10:02 PM
Aron1973 #1
Posted 28 February 2014 - 11:02 PM
I gave a slight issue here! I'm not sure if its a bug or what. But i'm using thees 2 (pastebin down below) programs together with Drewolf20's button api.and i get this error
printer:5: invalid type of return value 0: expected BOOLEAN, got true or the same error on line 7 depeding on what button i press. No i do get the ticket from the ticket machine but after that the program halts with that error. I o get the same error when in the lua prompt when I do a "maual" crete ticket comand can some one plz help me

Pastebn: iZ7k5U0Y trainScreen iH9FVATt printer
Bomb Bloke #2
Posted 01 March 2014 - 03:49 AM
So if I've got this right, you've wrapped a Ticket Machine as a peripheral, and attempting something like this:

local booleanInfo = TM.createTicket("South/SeaStation")

… triggers the error, but the machine still creates the ticket. It acts this way whether you run the line via your script, or directly via the Lua prompt.

Is that all correct?
Aron1973 #3
Posted 01 March 2014 - 09:52 AM
yes thats correct
Bomb Bloke #4
Posted 02 March 2014 - 01:19 PM
I tried the line with a Ticket Machine myself under a couple of different mod packs, and couldn't get that behaviour.

Seemed to work perfectly under Unleashed 1.1.3, while under DW20 1.0.11 the game initially crashed before I could try. My second attempt revealed that version can't access the ticket printing functions at all.

There are other recentish reports of stability issues with the Ticket Machine, so were I you I'd be checking my current versions and considering updating. Assuming that doesn't help, you may, with luck, get somewhere with the pcall (protected call) function.

I've not tried it, but I believe it'd go something like this:

pcall(TM.createTicket,"South/SeaStation")
Aron1973 #5
Posted 02 March 2014 - 02:26 PM
Well atm i'm on a Direwolf20 1.6.4 server and we are runing 1.0.1.4 verson. We did have some issues with the ticket machine in 1.0.1.2 but that was due to a bug causeing the computer not to reckognice the ticket machine as a peripheral.
Well hx for te help