Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ui
- import player
- import net
- import shop
- import chat
- roska = 0
- status = 0
- cena_roski = 5000000 #USTAW CENE ROSKI
- class BotDoRosPL(ui.Board):
- def __init__(self):
- ui.Board.__init__(self)
- self.ZbudujOkno()
- def __del__(self):
- ui.Board.__del__(self)
- def Destroy(self):
- self.Hide()
- return TRUE
- def ZbudujOkno(self):
- self.SetCenterPosition(-100, -170)
- self.SetSize(200, 350)
- self.Show()
- self.AddFlag("float")
- self.AddFlag("movable")
- self.LoadButtons()
- def LoadButtons(self):
- self.CloseButton = ui.Button()
- self.CloseButton.SetParent(self)
- self.CloseButton.SetPosition(self.GetWidth()-23, 8)
- self.CloseButton.SetToolTipText("Zamknij")
- self.CloseButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
- self.CloseButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
- self.CloseButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")
- self.CloseButton.SetEvent(ui.__mem_func__(self.Close))
- self.CloseButton.Show()
- self.Rosa1 = ui.ExpandedImageBox()
- self.Rosa1.SetParent(self)
- self.Rosa1.SetPosition(40, 40)
- self.Rosa1.LoadImage(str("icon/item/50821.tga"))
- self.Rosa1.Show()
- self.Rosa1Button = ui.Button()
- self.Rosa1Button.SetParent(self.Rosa1)
- self.Rosa1Button.SetToolTipText("Czerwona rosa", 16, -5)
- self.Rosa1Button.SetPosition(0, 0)
- self.Rosa1Button.SetSize(30, 30)
- self.Rosa1Button.SetEvent(self.Wybierz1)
- self.Rosa1Button.Show()
- self.Rosa2 = ui.ExpandedImageBox()
- self.Rosa2.SetParent(self)
- self.Rosa2.SetPosition(82, 40)
- self.Rosa2.LoadImage(str("icon/item/50822.tga"))
- self.Rosa2.Show()
- self.Rosa2Button = ui.Button()
- self.Rosa2Button.SetParent(self.Rosa2)
- self.Rosa2Button.SetToolTipText("Różowa rosa", 16, -5)
- self.Rosa2Button.SetPosition(0, 0)
- self.Rosa2Button.SetSize(30, 30)
- self.Rosa2Button.SetEvent(self.Wybierz2)
- self.Rosa2Button.Show()
- self.Rosa3 = ui.ExpandedImageBox()
- self.Rosa3.SetParent(self)
- self.Rosa3.SetPosition(124, 40)
- self.Rosa3.LoadImage(str("icon/item/50823.tga"))
- self.Rosa3.Show()
- self.Rosa3Button = ui.Button()
- self.Rosa3Button.SetParent(self.Rosa3)
- self.Rosa3Button.SetToolTipText("Żółta rosa", 16, -5)
- self.Rosa3Button.SetPosition(0, 0)
- self.Rosa3Button.SetSize(30, 30)
- self.Rosa3Button.SetEvent(self.Wybierz3)
- self.Rosa3Button.Show()
- self.Rosa4 = ui.ExpandedImageBox()
- self.Rosa4.SetParent(self)
- self.Rosa4.SetPosition(40, 110)
- self.Rosa4.LoadImage(str("icon/item/50824.tga"))
- self.Rosa4.Show()
- self.Rosa4Button = ui.Button()
- self.Rosa4Button.SetParent(self.Rosa4)
- self.Rosa4Button.SetToolTipText("Zielona rosa", 16, -5)
- self.Rosa4Button.SetPosition(0, 0)
- self.Rosa4Button.SetSize(30, 30)
- self.Rosa4Button.SetEvent(self.Wybierz4)
- self.Rosa4Button.Show()
- self.Rosa5 = ui.ExpandedImageBox()
- self.Rosa5.SetParent(self)
- self.Rosa5.SetPosition(82, 110)
- self.Rosa5.LoadImage(str("icon/item/50825.tga"))
- self.Rosa5.Show()
- self.Rosa5Button = ui.Button()
- self.Rosa5Button.SetParent(self.Rosa5)
- self.Rosa5Button.SetToolTipText("Niebieska rosa", 16, -5)
- self.Rosa5Button.SetPosition(0, 0)
- self.Rosa5Button.SetSize(30, 30)
- self.Rosa5Button.SetEvent(self.Wybierz5)
- self.Rosa5Button.Show()
- self.Rosa6 = ui.ExpandedImageBox()
- self.Rosa6.SetParent(self)
- self.Rosa6.SetPosition(124, 110)
- self.Rosa6.LoadImage(str("icon/item/50826.tga"))
- self.Rosa6.Show()
- self.Rosa6Button = ui.Button()
- self.Rosa6Button.SetParent(self.Rosa6)
- self.Rosa6Button.SetToolTipText("Biała rosa", 16, -5)
- self.Rosa6Button.SetPosition(0, 0)
- self.Rosa6Button.SetSize(30, 30)
- self.Rosa6Button.SetEvent(self.Wybierz6)
- self.Rosa6Button.Show()
- self.Title = ui.TextLine()
- self.Title.SetParent(self)
- self.Title.SetPosition(50, 15)
- self.Title.SetText("|cFFddb30dBot do ros ~ KoYGeR")
- self.Title.Show()
- self.Napis2 = ui.TextLine()
- self.Napis2.SetParent(self)
- self.Napis2.SetPosition(67, 170)
- self.Napis2.SetFontColor(0.0, 0.7, 0.7)
- self.Napis2.SetText("Wybrana rosa:")
- self.Napis2.Show()
- self.Napis3 = ui.TextLine()
- self.Napis3.SetParent(self)
- self.Napis3.SetPosition(93, 185)
- self.Napis3.SetFontColor(1.0, 1.0, 1.0)
- self.Napis3.SetText("---")
- self.Napis3.Show()
- self.Napis = ui.TextLine()
- self.Napis.SetParent(self)
- self.Napis.SetPosition(60, 210)
- self.Napis.SetFontColor(0.0, 0.7, 0.7)
- self.Napis.SetText("Minimalna wartość:")
- self.Napis.Show()
- self.WartoscBar = ui.SlotBar()
- self.WartoscBar.SetParent(self)
- self.WartoscBar.SetSize(30, 15)
- self.WartoscBar.SetPosition(85, 225)
- self.WartoscBar.Show()
- self.WartoscRoski = ui.EditLine()
- self.WartoscRoski.SetParent(self.WartoscBar)
- self.WartoscRoski.SetSize(110, 15)
- self.WartoscRoski.SetPosition(5, 0)
- self.WartoscRoski.SetMax(3)
- self.WartoscRoski.SetNumberMode()
- self.WartoscRoski.SetFocus()
- self.WartoscRoski.SetText("0")
- self.WartoscRoski.Show()
- self.Napis1 = ui.TextLine()
- self.Napis1.SetParent(self)
- self.Napis1.SetPosition(75, 255)
- self.Napis1.SetFontColor(0.0, 0.7, 0.7)
- self.Napis1.SetText("Czas trwania:")
- self.Napis1.Show()
- self.CzasBar = ui.SlotBar()
- self.CzasBar.SetParent(self)
- self.CzasBar.SetSize(30, 15)
- self.CzasBar.SetPosition(85, 270)
- self.CzasBar.Show()
- self.CzasRoski = ui.EditLine()
- self.CzasRoski.SetParent(self.CzasBar)
- self.CzasRoski.SetSize(110, 15)
- self.CzasRoski.SetPosition(5, 0)
- self.CzasRoski.SetMax(2)
- self.CzasRoski.SetNumberMode()
- self.CzasRoski.SetFocus()
- self.CzasRoski.SetText("0")
- self.CzasRoski.Show()
- self.StartButton = ui.Button()
- self.StartButton.SetParent(self)
- self.StartButton.SetPosition(75, 295)
- self.StartButton.SetUpVisual("d:/ymir work/ui/public/big_Button_01.sub")
- self.StartButton.SetOverVisual("d:/ymir work/ui/public/big_Button_02.sub")
- self.StartButton.SetDownVisual("d:/ymir work/ui/public/big_Button_03.sub")
- self.StartButton.SetEvent(self.Kupuj)
- self.StartButton.SetText("Start")
- self.StartButton.Show()
- def Close(self):
- self.Hide()
- def Wybierz1(self):
- global roska
- self.Napis3.SetText("Czerwona")
- self.Napis3.SetFontColor(1.0, 0, 0)
- self.Napis3.SetPosition(78, 185)
- roska = 50821
- def Wybierz2(self):
- global roska
- self.Napis3.SetText("Różowa")
- self.Napis3.SetFontColor(1.0, 0.4, 0)
- self.Napis3.SetPosition(80, 185)
- roska = 50822
- def Wybierz3(self):
- global roska
- self.Napis3.SetText("Żółta")
- self.Napis3.SetFontColor(1.0, 0.8, 0)
- self.Napis3.SetPosition(88, 185)
- roska = 50823
- def Wybierz4(self):
- global roska
- self.Napis3.SetText("Zielona")
- self.Napis3.SetFontColor(0.1, 1.0, 0)
- self.Napis3.SetPosition(82, 185)
- roska = 50824
- def Wybierz5(self):
- global roska
- self.Napis3.SetText("Niebieska")
- self.Napis3.SetFontColor(0.0, 0.2, 1.0)
- self.Napis3.SetPosition(78, 185)
- roska = 50825
- def Wybierz6(self):
- global roska
- self.Napis3.SetText("Biała")
- self.Napis3.SetFontColor(1.0, 1.0, 1.0)
- self.Napis3.SetPosition(88, 185)
- roska = 50826
- def Kupuj(self):
- global status
- if status == 0:
- status = 1
- self.StartButton.SetText("Zatrzymaj")
- self.KupowanieRosek()
- else:
- status = 0
- self.StartButton.SetText("Start")
- def KupowanieRosek(self):
- global status
- Yang = player.GetMoney()
- if status == 1:
- if roska == 0:
- chat.AppendChat(chat.CHAT_TYPE_NOTICE, "[Błąd] Wybierz którąś z rosek!")
- status = 0
- self.StartButton.SetText("Start")
- return
- if Yang <= cena_roski:
- chat.AppendChat(chat.CHAT_TYPE_NOTICE, "[Błąd] Nie masz wystarczająco kasy :(")
- status = 0
- self.StartButton.SetText("Start")
- return
- for slot in xrange(shop.SHOP_SLOT_COUNT):
- ShopItemValue = shop.GetItemID(slot)
- lel = roska
- if ShopItemValue == int(lel):
- net.SendShopBuyPacket(slot)
- self.Czekaj = WaitingDialog()
- self.Czekaj.Open(0.5)
- self.Czekaj.SAFE_SetTimeOverEvent(self.KupowanieRosek)
- ItemIndex = roska
- MinValue = int(self.WartoscRoski.GetText())
- MinTime = int(self.CzasRoski.GetText())
- for InventorySlot in xrange(player.INVENTORY_PAGE_SIZE*2):
- ItemIndex = player.GetItemIndex(InventorySlot)
- ItemValue = roska
- (Value0, Value, Time) = [ player.GetItemMetinSocket(InventorySlot, i) for i in xrange(player.METIN_SOCKET_MAX_NUM) ]
- if ItemIndex == ItemValue and (Value < MinValue or Time < MinTime):
- net.SendShopSellPacket(InventorySlot)
- else:
- pass
- class WaitingDialog(ui.ScriptWindow):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.eventTimeOver = lambda *arg: None
- self.eventExit = lambda *arg: None
- def __del__(self):
- ui.ScriptWindow.__del__(self)
- def Open(self, waitTime):
- import time
- curTime = time.clock()
- self.endTime = curTime + waitTime
- self.Show()
- def Close(self):
- self.Hide()
- def Destroy(self):
- self.Hide()
- def SAFE_SetTimeOverEvent(self, event):
- self.eventTimeOver = ui.__mem_func__(event)
- def SAFE_SetExitEvent(self, event):
- self.eventExit = ui.__mem_func__(event)
- def OnUpdate(self):
- import time
- lastTime = max(0, self.endTime - time.clock())
- if 0 == lastTime:
- self.Close()
- self.eventTimeOver()
- else:
- return
- def OnPressExitKey(self):
- self.Close()
- return TRUE
- StartDialog = BotDoRosPL()
- StartDialog.Show()
Advertisement
Add Comment
Please, Sign In to add comment