Advertisement
mgostih

Confronto autopickup

Feb 7th, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.57 KB | None | 0 0
  1.     def AutoPick_func(self):
  2.                 global apick
  3.         if self.AutoPick.GetText() == 'Turn On':
  4.                         self.AutoPick.SetText('Turn Off')
  5.                         apick = 1
  6.                 elif self.AutoPick.GetText() == 'Start':
  7.                         self.AutoPick.SetText('Turn Off')
  8.                         self.AutoPickup()
  9.                         apick = 1
  10.                 else:
  11.                         self.AutoPick.SetText('Turn On')
  12.                         apick = 0
  13.                        
  14.         def AutoPickup(self):
  15.                 if apick == 1:
  16.                         player.PickCloseItem()
  17.                 self.delay = WaitingDialog()
  18.                 self.delay.Open(int(0.5))
  19.                 self.delay.Safe_SetTimeOverEvent(self.EnableAutoPickup)
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. -------------------------------------------------------------------------------------------------------
  29.  
  30.  
  31.  
  32.     def AutoPickup(self):
  33.  
  34.         global AutoPickup
  35.        
  36.         if AutoPickup == 0:
  37.             AutoPickup = 1
  38.             self.AutoPickupButton.SetText("On")
  39.             self.EnableAutoPickup()
  40.         else:  
  41.             AutoPickup = 0
  42.             self.AutoPickupButton.SetText("Off")
  43.             self.DisableAutoPickup()
  44.        
  45.     def EnableAutoPickup(self):
  46.        
  47.        
  48.        
  49.         player.PickCloseItem()
  50.        
  51.         self.delay = WaitingDialog()
  52.         self.delay.Open(int(0.5))
  53.         self.delay.SAFE_SetTimeOverEvent(self.EnableAutoPickup)
  54.            
  55.     def DisableAutoPickup(self):
  56.        
  57.         player.PickCloseItem()
  58.        
  59.         self.delay = WaitingDialog()
  60.         self.delay.Open(int(999999999999999999999999999999))
  61.         self.delay.SAFE_SetTimeOverEvent(self.DisableAutoPickup)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement