Jump to content


Xande's Content

There have been 6 items by Xande (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#201967 Programm hangs up after os.pullEvent()

Posted by Xande on 01 January 2015 - 02:13 PM in Ask a Pro

Thanks a lot,

i was able to find the problem.

I had to add
local EVENT = os.pullEvent()

into Main "Viewer" program.



#201965 Programm hangs up after os.pullEvent()

Posted by Xande on 01 January 2015 - 12:22 PM in Ask a Pro

I tested it by adding to print statements as following in the code
print("movement started")
local event, side, x, y = os.pullEvent()
if event == "monitor_touch" then
  print("Touch detected at"..x.." X and "..y.." Y")

Whenever i started the program over shell.run() it just printed out "movement started" but does not printed out
"Touch detect at ( x- pos) X and (y - pos) Y" when i am touching the sceen.



#201947 Programm hangs up after os.pullEvent()

Posted by Xande on 01 January 2015 - 01:10 AM in Ask a Pro

View PostBomb Bloke, on 31 December 2014 - 11:55 PM, said:

View PostLyqyd, on 31 December 2014 - 09:12 PM, said:

Just to confirm, you are using an advanced monitor, and right-clicking within the appropriate area on the screen?

He's saying that the click-detection code is in its own script. Running that directly works, but executing it via shell.run() inside the main script apparently does not.

My guess is that it's either hanging up in the "draw" or "getTank" scripts, before it ever gets around to starting the "movement" script.

I teste it before, because i already had suspicion like that but the programm stopped exactly at
local event, side, x, y = os.pullEvent()

This means that i was able to run the programm "movement".



#201928 Programm hangs up after os.pullEvent()

Posted by Xande on 31 December 2014 - 10:10 PM in Ask a Pro

Yes, i do use a advanced monitor as seen in the picture below
Spoiler

And i am also right-clicking in the in the approptiate area.

Could this have to do something with the fact, that i am using CC 1.5?



#201920 Programm hangs up after os.pullEvent()

Posted by Xande on 31 December 2014 - 08:06 PM in Ask a Pro

I do know, that os.pullEvent() waits for an event and in this case the event is "monitor_touch", the problem is,
that if i "touch" the monitor, the event does not get triggered.

For example, if i touch the screen at some point ( x = 9 and y = 13 for example) the code should continue with
rednet.send(5, "Down")
   break

but it does not continue.



#201914 Programm hangs up after os.pullEvent()

Posted by Xande on 31 December 2014 - 06:49 PM in Ask a Pro

Hello there,

I am currently coding my first turtle mining programm, which scanns the environment and displays all
the given information about it(the blocks around the turtle) and the turtle(FuelLevel) out on a Monitor.

Now i am trying to make a programm, who allows the user to move the turtle when he
click on one of the printet Blocks.

The programm i made for that works fine, if i start it alone, but whenever i try to open it with
shell.run("ProgrammName")
the programm just hang up and i need to terminat it.

The code whit which i have trouble with:
Spoiler

an here the code i use to run the code above:
Spoiler

The Problem i have, is that it seems like the code hang up at
local event, side, x, y = os.pullEvent()

And if it is helpful here's the main "Turtelcode" which is used to call the different functions:
Spoiler

And the code which actually moves the turtle:
Spoiler

I'll already stuck at this problem since 5 hours now and still haven't found the reason why it behave like this especially because it does work, when i start the programm(movement) separately.

Thanks in advance