Edited for Content
Quote: "my system needs to know what object he is looking at, otherwise i cant build nothing."
I don't know how your game is set up, but this is how I'd do it if it worked like your standard building game:
Player clicks on an object to select it.
Pick Object is used to grab the object and objects location.
Selected objects Object Number and Location are stored in an array.
Repeat
... As the player moves the object, the array updates based upon the mouse movement or other input commands.
... Reposition the selected object to the new location stored in the array.
Until the player clicks the mouse again, which empties the array or repicks a new object.
In the case of timers to prevent a check every loop, here's the easiest way I know.
//Create a variable to use as your timer
MyRandomVariable as integer
/Begin your program loop
Do
//Add 1 to your timer each loop
INC MyRandomVariable
//If your variable is high enough (At least 4, in this case)
if MyRandomVariable>3
//Run your timed code
Pick Object
//Reset your timer so that the process starts over
MyRandomVariable=0
endif
//End your main program loop
Loop
An alternate form that would allow you to call some code on a true set timer instead of basing it on your FPS would look more like this:
//Declare your variables (We need 3)
Variable1 as integer
Variable2 as integer
Variable3 as integer
//Set the first integer to the PC's internal timer
//This will give us a baseline to use to track time passed
Variable1=timer()
//Begin your main game loop
Do
//At the beginning of the loop, set variable2 to the timer
//This one will always be the total time passed
Variable2=Timer()
//Subtract Variable1 from Variable2 to find the actual time passed
Variable3=Variable2-Variable1
//If time passed is greater than 200 (1000 Timer=1 second)
//This will run 5 times per second
If Variable3=>200
//Run your timed code
Pick Object
//Reset your Variable1 to start counting from 0 again
Variable1=Timer()
endif
//End your main program loop
Loop
I'm at work right now, so I don't have DBP available. My code likely has typos and such since I'm doing it all from memory.