Yoko
http://forum.yoko.com.ua/

Gump Handling
http://forum.yoko.com.ua/viewtopic.php?f=20&t=17244
Page 1 of 1

Author:  DracoX [ 2013-04-25 15:41:25 ]
Post subject:  Gump Handling

; ; Gump
; ; Wait Gump Serial
# # Wait a gump checking for it's serial
; ; Wait Gump ID
# # Wait a gump checking for it's gumpid
; ; Wait Gump Text
# # Wait a gump checking for it's text
; ; Wait Gump Command
# # Wait a gump checking for it's Command
; ; In Gump Text
# # Returns the position of the gump's text that contains the text
; ; In Gump Command
# # Returns the position of the gump's command that contains the text
; ; Gump Text Count
# # Count how many 'command' options are texts
; ; Gump Button Count
# # Count how many 'command' options are buttons
; ; Click Gump Command
# # Click the x and y positions of a button in the 'command' options of a gump, checking if it is a button
; ; Click Gump Button
# # Click the x and y positinos of a button just counting buttons, that means 1 is the first button and not the first 'command' option
; ; Close Gump
# # Right click the gump x and y positions (+10 to avoid clicking in rounded corners) to close it



; 99.45 - Gump ; {
; 99.45.00 - Wait Gump Serial ; {
# serial = gump serial
# timeout = maximum time to wait
Sub WaitGumpSerial(serial,timeout)
Repeat
Wait(100)
If Not CheckWorldSave() Then
timeout=timeout-0.1
End If
Until (UO.LastGump('replyed')==0 And UO.LastGump('serial')==serial) Or timeout<=0
Wait(500)
Ping()
End Sub
; ; }
; 99.45.05 - Wait Gump ID ; {
# gumpid = gump id
# timeout = maximum time to wait
Sub WaitGumpID(gumpid,timeout)
Repeat
Wait(100)
If Not CheckWorldSave() Then
timeout=timeout-0.1
End If
Until (UO.LastGump('replyed')==0 And UO.LastGump('gumpid')==gumpid) Or timeout<=0
Wait(500)
Ping()
End Sub
; ; }
; 99.45.10 - Wait Gump Text ; {
# text = text in the gump text
# position = text position in the gump
# timeout = maximum time to wait
Sub WaitGumpText(text,position,timeout)
Repeat
Wait(100)
If Not CheckWorldSave() Then
timeout=timeout-0.1
End If
Until (UO.LastGump('replyed')==0 And InText(text,UO.LastGump('text',position))) Or timeout<=0
Wait(500)
Ping()
End Sub
; ; }
; 99.45.15 - Wait Gump Command ; {
# command = text in the gump command
# position = command position in the gump
# timeout = maximum time to wait
Sub WaitGumpCommand(command,position,timeout)
Repeat
Wait(100)
If Not CheckWorldSave() Then
timeout=timeout-0.1
End If
Until (UO.LastGump('replyed')==0 And InText(command,UO.LastGump('command',position))) Or timeout<=0
Wait(500)
Ping()
End Sub
; ; }
; 99.45.20 - In Gump Text ; {
# text = text in the gump texts
Sub InGumpText(text)
var loop=0
While UO.LastGump('text',loop)<>'N/A'
If InText(text,UO.LastGump('text',loop)) Then
return loop
End If
loop=loop+1
WEnd
return -1
End Sub
; ; }
; 99.45.25 - In Gump Command ; {
# command = text in the gump commands
Sub InGumpCommand(command)
var loop=0
While UO.LastGump('command',loop)<>'N/A'
If InText(command,UO.LastGump('command',loop)) Then
return loop
End If
loop=loop+1
WEnd
return -1
End Sub
; ; }
; 99.45.30 - Gump Text Count ; {
# none
Sub GumpTextCount()
var loop=0
var count=0
While UO.LastGump('command',loop)<>'N/A'
If Left(UO.LastGump('command',loop),3)=='ext' Then
count=count+1
End If
loop=loop+1
WEnd
return count
End Sub
; ; }
; 99.45.35 - Gump Button Count ; {
# none
Sub GumpButtonCount()
var loop=0
var count=0
While UO.LastGump('command',loop)<>'N/A'
If Left(UO.LastGump('command',loop),3)=='utton' Then
count=count+1
End If
loop=loop+1
WEnd
return count
End Sub
; ; }
; 99.45.40 - Click Gump Command ; {
# position = command position in the gump
Sub ClickGumpCommand(position)
position=position-1
If UO.LastGump('command',position)<>'N/A' Then
If GetWord(UO.LastGump('command',position),1)=='utton' Then
UO.LClick(val(GetWord(UO.LastGump('command',position),2))+UO.LastGump('x'),val(GetWord(UO.LastGump('command',position),3))+UO.LastGump('y'))
End If
return -1
End If
return 0
End Sub
; ; }
; 99.45.45 - Click Gump Button ; {
# button = button count in command in the gump
Sub ClickGumpButton(button)
var position=0
var count=0
While UO.LastGump('command',position)<>'N/A' And count<button
If Left(UO.LastGump('command',position),3)=='utton' Then
count=count+1
End If
position=position+1
WEnd
return ClickGumpCommand(position)
End Sub
; ; }
; 99.45.50 - Close Gump ; {
# none
Sub CloseGump()
If UO.LastGump('replyed')==0 Then
UO.RClick(UO.LastGump('x')+10,UO.LastGump('y')+10)
End If
End Sub
; ; }
; ; }

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/