Yoko

All sides of Injection
It is currently 2025-11-14 22:44:04

All times are UTC+02:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 2007-04-24 22:15:53 
Offline

Joined: 2005-04-13 16:01:09
Posts: 48
How can i make my script to wait until i press a key?

Imagine that if i press 1 i want my script to do somehitng, but if i press 2 i want it to do other thing.
Please help! ;)
thanks


Top
   
 Post subject:
PostPosted: 2007-04-25 12:09:15 
Offline
Expert!
User avatar

Joined: 2006-02-25 21:48:38
Posts: 1032
Use hotkeys :wink:

1) Load script, for example:
Code:
sub my_first_scp
  uo.say('Hello, world!')
end sub

2) Bind this csp on keyboard key, for example:
Image
3) Get fun!

_________________
DerMeister сейчас на нейрале!


Top
   
 Post subject:
PostPosted: 2007-04-25 14:09:23 
Offline

Joined: 2005-04-13 16:01:09
Posts: 48
hadnt undestand haha.
I dont mean hoykeys..

I want a script that if u press for example "1", it makes something.
If press "2" makes other thing.

wait
until uo.press()

but dont works :P
help?


Top
   
 Post subject:
PostPosted: 2007-04-25 14:25:47 
Offline
Expert!
User avatar

Joined: 2006-02-25 21:48:38
Posts: 1032
Code:
sub mn
  ...
  repeat
    wait(100)
  until uo.getglobal('qwerty1') or uo.getglobal('qwerty2') or ... etc ...

  if uo.getglobal('qwerty1') then
  ...
  if uo.getglobal('qwerty2') then
  ...
  if uo.getglobal('qwerty3') then
  ... 

  ...

end sub


sub m1
  uo.setglobal('qwerty1','true')
  wait(500)
  uo.setglobal('qwerty1','false')
end sub

sub m2
  uo.setglobal('qwerty2','true')
  wait(500)
  uo.setglobal('qwerty2','false')
end sub


...




Add m1, m2, m3 , ... etc ... to hotkeys as you see below and enjoy yourself.

PS: My english is bad :(

_________________
DerMeister сейчас на нейрале!


Top
   
 Post subject:
PostPosted: 2007-04-26 13:54:43 
Offline

Joined: 2005-04-13 16:01:09
Posts: 48
sorry man, ive been tring but dont understand xD.

Imagine that if I press "1" i want it to say hello.
If i press "2" i want it to say Good bye.

Could u make this example for me plz? ;) thanks


Top
   
 Post subject:
PostPosted: 2007-04-26 18:19:23 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
motxu wrote:
sorry man, ive been tring but dont understand xD.

Imagine that if I press "1" i want it to say hello.
If i press "2" i want it to say Good bye.

Could u make this example for me plz? ;) thanks

Code:
Injection > Hotkeys > 
1 msg "hello"
2 msg "Good bye."


there is no such thing like injection could know what key do you press, it's working with the game not with the user actions

you can use global variable

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2007-04-26 19:21:18 
Offline
Expert!
User avatar

Joined: 2006-02-25 21:48:38
Posts: 1032
motxu wrote:
sorry man, ive been tring but dont understand xD.

Imagine that if I press "1" i want it to say hello.
If i press "2" i want it to say Good bye.

Could u make this example for me plz? ;) thanks


Code:
sub main 
while true
  repeat
    wait(100)
  until uo.getglobal('qwerty1') or uo.getglobal('qwerty2')

  if uo.getglobal('qwerty1') then
  uo.say('Hello')
  if uo.getglobal('qwerty2') then
  uo.say('Good bye')
wend
end sub


sub m1
  uo.setglobal('qwerty1','true')
  wait(250)
  uo.setglobal('qwerty1','false')
end sub

sub m2
  uo.setglobal('qwerty2','true')
  wait(250)
  uo.setglobal('qwerty2','false')
end sub


1) Bind 1 with "m1" sub and 2 with "m2" sub (exec m1) and (exec m2)
2) Launch "main"
3) press 1 or 2 on your keyboard.

_________________
DerMeister сейчас на нейрале!


Top
   
 Post subject:
PostPosted: 2007-04-27 13:33:11 
Offline

Joined: 2005-04-13 16:01:09
Posts: 48
;) :D ;)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited