Page 1 of 1

prompting user

Posted: 2004-04-27 20:48:50
by hunt3r
Heloo, how can i prompt a user or get that he clicks on an specific object?
lemme explain
1- prompt
something like, appears a message to user "Say the number of times you want to loop the macro".... and the user writes the number and i get into
a var :D

2- I wanna get some serial, like a prompt "click on the three you wanto to shop"
and put the targeted's id into a var like this

var tree_id=uo.exec("info") //ficticious, this doesnt work...

sorry my bad english and thank u very much :D

Posted: 2004-04-28 00:25:54
by Lord Ruslan Nightmare
Here is my solution. Works fine, i think...

Code: Select all

sub PromptObject(s)
  var last
  uo.Info("self")
  last = uo.getserial("lasttarget")
  uo.print(s)
  uo.canceltarget()
  uo.Info()
  while last == uo.getserial("lasttarget") and uo.targeting()
    wait(100)
  wend
  return uo.getserial("lasttarget")
end sub

Of course, this script will not allow you to target self

Posted: 2004-04-29 18:25:43
by dodo
Бля! Спасибо!!! :-)
Ай да я! ай да тормоз !

Genious!

Posted: 2004-04-30 13:51:23
by hunt3r
Man! Youuuuu, youuuuuu :) u're a genoius....
I have to made some changes, but its exactly what i need!

Code: Select all

sub main()
  var id_obj=PromptObject()
  uo.print(""+id_obj)
end sub
sub PromptObject()
  var last
  uo.Info()
  uo.exec("textclose")
  last = uo.getserial("lasttarget")
  uo.canceltarget()
  uo.Info()
  while last == uo.getserial("lasttarget") and uo.targeting()
    wait(100)
  wend
  uo.exec("textclear")
  uo.exec("textclose")
  return uo.getserial("lasttarget")
end sub


But I already have one doubt....
And what about a text prompt? or a Gump, with some choices, or a txtField to user write something?

Thanks VM