Problem with command execution

Asked

Viewed 35 times

0

Currently I am doing some tests with the execution of commands through the mouse and with loops, see below:

if $MouseOnEvent == -1 
  if @teste == 1
    print "test"
    @teste = 0
  end 
end

if $MouseOnEvent != -1
  @teste = 1
  return
end

The condition says that whenever the mouse is outside such an area, it will execute the "print" command. When leaving, it just arrow for the condition to be made again.

My problem, is that when the condition is satisfied, the print command runs several times (about 30), until it stops(this should not happen since the first time it should already change the value of @test), I would like to know a possible cause for this.

  • It has how you show how the call is made of the method in which this code is found?

  • Could you give more details of the code? Some context, which libraries are being used, etc.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.