forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


wait event problem :(

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Sun Apr 11, 2004 10:13 pm    Post subject: wait event problem :( Reply with quote

hello all

i have been playing with the hotkeys commads BUT i see for the hotkeys to work it need a "wait event" in the evloop problem is in my script i don't have a normal evloop Sad i have tried diff ways to added it but i can't get it to work here is what i have

Code:

:waitloop
dialog setpos,,@diff(@mousepos(y),20),@diff(@mousepos(x),20)
window ontop,#MouseDisablerDot
%x = @succ(%x)
if @equal(%x,100)
  wait 0.001
  %x = 0
end
if @greater(@datetime(hhnnss),%%end_time)
goto loop2
end


I need to added this

Code:

wait event
  %E = @event()
  goto %E


when i added this to my code about of coures it stops at the "wait event" and it don't finish the rest of my code...if ya follow what i mean Sad

any way to fix this?

thanks

_________________
Have a nice day Smile
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Apr 12, 2004 7:58 am    Post subject: Reply with quote

i think the use of the timer would be what you need

Code:

:timer
dialog setpos,,@diff(@mousepos(y),20),@diff(@mousepos(x),20)
window ontop,#MouseDisablerDot
%x = @succ(%x)
if @equal(%x,100)
  wait 0.001
  %x = 0
end
if @greater(@datetime(hhnnss),%%end_time)
goto loop2
end

:evloop
wait event, fdiv(1,10)
goto @event()


this way the script goes through the timer every 1/10 seconds even though it is "waiting" for an event...weird but it works

the FDIV(1,10) is so that you don't have to worry about whether a computer uses "." or "," for their decimal point

hope this helps

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Apr 12, 2004 2:30 pm    Post subject: Reply with quote

hummm

it still hangs at the "wait event" here is the whole script so you can see what i mean.......

thanks

Code:

option decimalsep,"."
%%seconds = 60
%x = 0
  DIALOG CREATE,test,@diff(@mousepos(y),20),@diff(@mousepos(x),20)),180,40,COLOR WHITE,NOTITLE,ONTOP,CLASS TPWaitWndClass
  DIALOG ADD,STYLE,BIG,,12,B,,
  DIALOG ADD,GROUP,WaitGroup,0,0,180,40
  DIALOG ADD,TEXT,TEXT1,15,55,,,test,,BIG
  DIALOG SHOW

%%start_time = @datetime(hhnnss)
%%end_time   = @fadd(@datetime(hhnnss),%%seconds)
 
:waitloop
dialog setpos,,@diff(@mousepos(y),20),@diff(@mousepos(x),20)
window ontop,#MouseDisablerDot
%x = @succ(%x)
if @equal(%x,100)
  wait 0.001
  %x = 0
end
if @greater(@datetime(hhnnss),%%end_time)
goto loop2
end

goto waitloop

:loop2
window hide,#TPWaitWndClass
info this is a test@cr() this is a test
exit

_________________
Have a nice day Smile
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Apr 12, 2004 3:54 pm    Post subject: Reply with quote

tim6389 wrote:
hummm

it still hangs at the "wait event" here is the whole script so you can see what i mean.......

thanks

Code:

option decimalsep,"."
%%seconds = 60
%x = 0
  DIALOG CREATE,test,@diff(@mousepos(y),20),@diff(@mousepos(x),20)),180,40,COLOR WHITE,NOTITLE,ONTOP,CLASS TPWaitWndClass
  DIALOG ADD,STYLE,BIG,,12,B,,
  DIALOG ADD,GROUP,WaitGroup,0,0,180,40
  DIALOG ADD,TEXT,TEXT1,15,55,,,test,,BIG
  DIALOG SHOW

%%start_time = @datetime(hhnnss)
%%end_time   = @fadd(@datetime(hhnnss),%%seconds)
 
:waitloop
dialog setpos,,@diff(@mousepos(y),20),@diff(@mousepos(x),20)
window ontop,#MouseDisablerDot
%x = @succ(%x)
if @equal(%x,100)
  wait 0.001
  %x = 0
end
if @greater(@datetime(hhnnss),%%end_time)
goto loop2
end
%E = @event()
If %E
  goto %E
End
goto waitloop

:loop2
window hide,#TPWaitWndClass
info this is a test@cr() this is a test
exit


You do not need a WAIT EVENT for events to work. Just capture the event from the @event() If you need to only respond to the HOTKEY event then change the if statement like the code below. Make sure your hotkeys have NAMES and make sub-routines by those names.
Code:

option decimalsep,"."
%%seconds = 60
%x = 0
  DIALOG CREATE,test,@diff(@mousepos(y),20),@diff(@mousepos(x),20)),180,40,COLOR WHITE,NOTITLE,ONTOP,CLASS TPWaitWndClass
  DIALOG ADD,STYLE,BIG,,12,B,,
  DIALOG ADD,GROUP,WaitGroup,0,0,180,40
  DIALOG ADD,TEXT,TEXT1,15,55,,,test,,BIG
  DIALOG SHOW

%%start_time = @datetime(hhnnss)
%%end_time   = @fadd(@datetime(hhnnss),%%seconds)
 
:waitloop
dialog setpos,,@diff(@mousepos(y),20),@diff(@mousepos(x),20)
window ontop,#MouseDisablerDot
%x = @succ(%x)
if @equal(%x,100)
  wait 0.001
  %x = 0
end
if @greater(@datetime(hhnnss),%%end_time)
goto loop2
end
%E = @event()
If @Equal(%E,HOTKEY)
  goto @HOTKEY()
End
goto waitloop

:loop2
window hide,#TPWaitWndClass
info this is a test@cr() this is a test
exit

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Apr 12, 2004 4:30 pm    Post subject: Reply with quote

hummm i thought i had the hotkey firgure out but i guess not i get lable not found....i know i must be missing something small.....i'am trying to uses F10 as the hotkey

thanks

Code:

option decimalsep,"."
%%seconds = 60
%x = 0
  DIALOG CREATE,test,@diff(@mousepos(y),20),@diff(@mousepos(x),20)),180,40,COLOR WHITE,NOTITLE,ONTOP,CLASS TPWaitWndClass
  DIALOG ADD,STYLE,BIG,,12,B,,
  DIALOG ADD,GROUP,WaitGroup,0,0,180,40
  DIALOG ADD,TEXT,TEXT1,15,55,,,test,,BIG
  DIALOG SHOW
 HOTKEY ADD,F10
%%start_time = @datetime(hhnnss)
%%end_time   = @fadd(@datetime(hhnnss),%%seconds)
 
:waitloop
dialog setpos,,@diff(@mousepos(y),20),@diff(@mousepos(x),20)
window ontop,#MouseDisablerDot
%x = @succ(%x)
if @equal(%x,100)
  wait 0.001
  %x = 0
end
if @greater(@datetime(hhnnss),%%end_time)
goto loop2
end
%E = @event()
If @Equal(%E,HOTKEY)
  goto @HOTKEY()
End
goto waitloop

:loop2
window hide,#TPWaitWndClass
info this is a test@cr() this is a test
exit

:HOTKEY
info test
exit

_________________
Have a nice day Smile
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Apr 12, 2004 5:00 pm    Post subject: Reply with quote

instead of
Code:
:HOTKEY
info test
exit


use
Code:
:f10
info test
exit


serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Apr 12, 2004 5:15 pm    Post subject: Reply with quote

ahhhhhh kk i got hotkey from the example .... i should have read it more

thanks guys

_________________
Have a nice day Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group