Official ScriptUO EasyUO Scripts > 12TimesOvers' Script Library

XIIxOveR's Standard Subs

(1/2) > >>

12TimesOver:
Just a thread for various subs I've written which I use regularly. These are probably the same or similar to what many other people use and probably already have in their libraries but I thought "Why Not".

XII

12TimesOver:

--- Code: ---;#######################
;SUB XIIxClickNWait
;#######################
; %1 = Required: Xoffset
; %2 = Required: Yoffset
; %3 = Required: #TRUE to wait for gump, any other value to return after click
; %4 = Required if %3 is #TRUE: Gump_Name
; %5 = Required if %3 is #TRUE: Gump_Size
sub XIIxClickNWait
   namespace push
   namespace local nsXIIxClickNWait
   set !clickx #contposx + %1
   set !clicky #contposy + %2
   set !gName1 %4
   set !gName2 %4
   set !gSize %5
   click !clickx !clicky
   if %3 <> #TRUE
      {
      namespace pop
      return
      }
   if %0 > 3
      gosub GumpWait !gName1 !gName2 !gSize
   namespace pop   
return

--- End code ---

12TimesOver:

--- Code: ---;#######################
;SUB XIIxGumpWait
;#######################
; %1 = Required: Gumpname 1
; %2 = Required only if using Gumpsize: Gumpname 2
; %3 = Optional: Gumpsize
; Returns #TRUE if gump occured before timeout, #FALSE if timeout occured
sub XIIxGumpWait
   namespace push
   namespace local nsXIIxGumpWait
   wait 10
   set !gName1 %1
   set !gName2 %2
   set !gSize %3
   set !_time #SCNT
   while #SCNT <= !_time + 5
      {
      if %0 > 2
         {
         if ( #CONTNAME = !gName1 && #CONTSIZE = !gSize ) || ( #CONTNAME = !gName2 && #CONTSIZE = !gSize )
            {
            namespace pop
            return #TRUE
            }
         }
      else
         {
         if #CONTNAME = !gName1 || #CONTNAME = !gName2
            {
            namespace pop
            return #TRUE
            }
         }
      }
   namespace pop
return #FALSE

--- End code ---

12TimesOver:

--- Code: ---;####################
;SUB XIIxMaxWeight
;####################
; %1 = Maxweight offset
sub XIIxMaxWeight
   Namespace Push
   Namespace Local nsXIIxMaxWeight
   set !offset %1
   If #maxweight = N/A
      {
      event macro 8 2
      wait 5
      event macro 10 2
      }

   set !MaxWeight #MaxWeight

   finditem #CHARID
   if #findtype NOTIN AV_XU_OCB_NCB ;char is human
      set !MaxWeight !MaxWeight + 60
      
   if !MaxWeight > 550
      set !MaxWeight 550 ;Backpack maximum

   set !MaxWeight !MaxWeight - !offset ;Adjust as see fit for overfull buffer
   set #RESULT !MaxWeight
   Namespace pop
Return #RESULT

--- End code ---

12TimesOver:

--- Code: ---;#######################
;SUB XIIxPause
;#######################
; %1 = Button position 1
; %2 = Button position 2
; %3 = Button position 3
; %4 = Button position 4
; %5 = Button Name
; e.g. "gosub pause 340 92 40 25 Pause"
Sub XIIxPause
   namespace push
   namespace local XIIxPause
   set !1 %1
   set !2 %2
   set !3 %3
   set !4 %4
   set !5 %5
   menu set Status Status: Paused
   menu delete !5
   menu Font BGColor BtnFace
   menu Font Color WindowText
   menu button resume !1 !2 !3 !4 Resume
   set #menubutton N/A
   while #menubutton <> Resume
      wait 1
   menu delete resume
   menu Font BGColor BtnFace
   menu Font Color WindowText
   menu Button !5 !1 !2 !3 !4 !5
   menu set Status Status: Working...
   namespace pop
Return
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version