Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Edycja BS'a


Rudy Piotrek

Rekomendowane odpowiedzi

Opublikowano

Witajcie! Mam problem z bs'em, gdyż po mojej edycji wczytywał tylko 3pierwsze bony zamiast 5.. Jeśli ktoś zna się na pythonie, prosiłbym o pomoc :C

 

Edit: to jest czysty bs

 

 

#######################################
## Bonusswitcher v1.7 by DaRealFreak ##
## Thanks @ Kamer1337, Crank, Passy  ##
## Translate @ krzywy                ##
#######################################
 
import chat
import item
import net
import player
import snd
import locale
import shop
import ui
import uiTip
 
Bonus0 = 0
Bonus1 = 0
Bonus2 = 0
Bonus3 = 0
Bonus4 = 0
SwitchButton = 0 
Boniswitchvalue = 71084
PRESSWISH0 = 0
PRESSWISH1 = 0
PRESSWISH2 = 0
PRESSWISH3 = 0
PRESSWISH4 = 0
 
class SwitchBotDialog(ui.BoardWithTitleBar):
def __init__(self):
ui.BoardWithTitleBar.__init__(self)
self.SetSize(450, 350)
self.SetCenterPosition()
self.AddFlag("movable")
self.AddFlag("float")
self.SetTitleName("BS")
self.SetCloseEvent(self.Close)
snd.PlaySound("sound/ui/type.wav")
self.LoadSwitchbotDialog()
 
def __del__(self):
ui.BoardWithTitleBar.__del__(self)
 
def Destroy(self):
self.Hide()
return TRUE
 
 
def LoadSwitchbotDialog(self):
 
self.LoadTextLines()
self.LoadButtons()
self.LoadEditLines()
 
self.BoardMessage = uiTip.BigBoard()
 
def LoadEditLines(self):
 
self.TimerText = ui.TextLine()
self.TimerText.SetParent(self)
self.TimerText.SetDefaultFontName()
self.TimerText.SetPosition(220, 190)
self.TimerText.SetFeather()
self.TimerText.SetText("Prędkość (w sekundach):")
self.TimerText.SetFontColor(0.6, 0.7, 1)
self.TimerText.SetOutline()
self.TimerText.Show() 
 
self.TimerF = ui.TextLine()
self.TimerF.SetParent(self)
self.TimerF.SetDefaultFontName()
self.TimerF.SetPosition(220, 215)
self.TimerF.SetFeather()
self.TimerF.SetText("Pamiętaj o kropce! Format [ 0.x ] !")
self.TimerF.SetFontColor(1, 1, 1)
self.TimerF.SetOutline()
self.TimerF.Show() 
 
self.TimerSlotBar = ui.SlotBar()
self.TimerSlotBar.SetParent(self)
self.TimerSlotBar.SetSize(29, 14)
self.TimerSlotBar.SetPosition(340, 190)
self.TimerSlotBar.Show()
 
self.TimerValue = ui.EditLine()
self.TimerValue.SetParent(self.TimerSlotBar)
self.TimerValue.SetSize(29, 18)
self.TimerValue.SetPosition(6, 0)
self.TimerValue.SetMax(3)
self.TimerValue.SetFocus()
self.TimerValue.SetText("0.5")
self.TimerValue.Show()
 
self.SlotwahlSlotBar = ui.SlotBar()
self.SlotwahlSlotBar.SetParent(self)
self.SlotwahlSlotBar.SetSize(29, 14)
self.SlotwahlSlotBar.SetPosition(190, 110)
self.SlotwahlSlotBar.SetWindowHorizontalAlignCenter()
self.SlotwahlSlotBar.Show()
 
self.Slotbar = ui.EditLine()
self.Slotbar.SetParent(self.SlotwahlSlotBar)
self.Slotbar.SetSize(29, 18)
self.Slotbar.SetPosition(6, 0)
self.Slotbar.SetMax(2)
self.Slotbar.SetNumberMode()
self.Slotbar.SetText("0")
self.Slotbar.SetTabEvent(ui.__mem_func__(self.StartSwitchBot))
self.Slotbar.SetReturnEvent(ui.__mem_func__(self.StartSwitchBot))
self.Slotbar.Show()
 
self.BonusValue2SlotBar = ui.SlotBar()
self.BonusValue2SlotBar.SetParent(self)
self.BonusValue2SlotBar.SetSize(29, 14)
self.BonusValue2SlotBar.SetPosition(-20, 79)
self.BonusValue2SlotBar.SetWindowHorizontalAlignCenter()
self.BonusValue2SlotBar.Show()
 
self.Bvalue2 = ui.EditLine()
self.Bvalue2.SetParent(self.BonusValue2SlotBar)
self.Bvalue2.SetSize(29, 18)
self.Bvalue2.SetPosition(6, 0)
self.Bvalue2.SetMax(4)
self.Bvalue2.SetNumberMode()
self.Bvalue2.SetText("0")
self.Bvalue2.Show()
 
self.BonusValue1SlotBar = ui.SlotBar()
self.BonusValue1SlotBar.SetParent(self)
self.BonusValue1SlotBar.SetSize(29, 14)
self.BonusValue1SlotBar.SetPosition(-20, 44)
self.BonusValue1SlotBar.SetWindowHorizontalAlignCenter()
self.BonusValue1SlotBar.Show()
 
self.Bvalue1 = ui.EditLine()
self.Bvalue1.SetParent(self.BonusValue1SlotBar)
self.Bvalue1.SetSize(29, 18)
self.Bvalue1.SetPosition(6, 0)
self.Bvalue1.SetMax(4)
self.Bvalue1.SetNumberMode()
self.Bvalue1.SetText("0")
self.Bvalue1.SetFocus()
self.Bvalue1.SetTabEvent(ui.__mem_func__(self.Bvalue2.SetFocus))
self.Bvalue1.SetReturnEvent(ui.__mem_func__(self.Bvalue2.SetFocus))
self.Bvalue1.Show()
 
def LoadButtons(self):
 
self.Wunschbonus01 = ui.Button()
self.Wunschbonus01.SetParent(self)
self.Wunschbonus01.SetPosition(15, 40)
self.Wunschbonus01.SetUpVisual("d:/ymir work/ui/public/Large_Button_01.sub")
self.Wunschbonus01.SetOverVisual("d:/ymir work/ui/public/Large_Button_02.sub")
self.Wunschbonus01.SetDownVisual("d:/ymir work/ui/public/Large_Button_03.sub")
self.Wunschbonus01.SetText("1.Bonus")
self.Wunschbonus01.SetEvent(ui.__mem_func__(self.__Wish_1_Option))
self.Wunschbonus01.Show()
 
self.Wunschbonus02 = ui.Button()
self.Wunschbonus02.SetParent(self)
self.Wunschbonus02.SetPosition(15, 75)
self.Wunschbonus02.SetUpVisual("d:/ymir work/ui/public/Large_Button_01.sub")
self.Wunschbonus02.SetOverVisual("d:/ymir work/ui/public/Large_Button_02.sub")
self.Wunschbonus02.SetDownVisual("d:/ymir work/ui/public/Large_Button_03.sub")
self.Wunschbonus02.SetText("2.Bonus")
self.Wunschbonus02.SetEvent(ui.__mem_func__(self.__Wish_2_Option))
self.Wunschbonus02.Show()
 
self.ResetbonusallButton = ui.Button()
self.ResetbonusallButton.SetParent(self)
self.ResetbonusallButton.SetPosition(90 + 45 + 95 - 100, 310)
self.ResetbonusallButton.SetUpVisual("d:/ymir work/ui/public/XLarge_Button_01.sub")
self.ResetbonusallButton.SetOverVisual("d:/ymir work/ui/public/XLarge_Button_02.sub")
self.ResetbonusallButton.SetDownVisual("d:/ymir work/ui/public/XLarge_Button_03.sub")
self.ResetbonusallButton.SetText("Resetuj bonusy")
self.ResetbonusallButton.SetEvent(ui.__mem_func__(self.__Resetbonusall))
self.ResetbonusallButton.Show()
 
self.Switchtingabbruchbutton = ui.Button()
self.Switchtingabbruchbutton.SetParent(self)
self.Switchtingabbruchbutton.SetPosition(90 + 45 + 95, 245)
self.Switchtingabbruchbutton.SetUpVisual("d:/ymir work/ui/public/XLarge_Button_01.sub")
self.Switchtingabbruchbutton.SetOverVisual("d:/ymir work/ui/public/XLarge_Button_02.sub")
self.Switchtingabbruchbutton.SetDownVisual("d:/ymir work/ui/public/XLarge_Button_03.sub")
self.Switchtingabbruchbutton.SetEvent(ui.__mem_func__(self.__BreakSwitching))
self.Switchtingabbruchbutton.SetText("Anuluj")
self.Switchtingabbruchbutton.Show()
 
self.StartButton = ui.Button()
self.StartButton.SetParent(self)
self.StartButton.SetPosition(30, 245)
self.StartButton.SetUpVisual("d:/ymir work/ui/public/XLarge_Button_01.sub")
self.StartButton.SetOverVisual("d:/ymir work/ui/public/XLarge_Button_02.sub")
self.StartButton.SetDownVisual("d:/ymir work/ui/public/XLarge_Button_03.sub")
self.StartButton.SetEvent(ui.__mem_func__(self.StartSwitchBot))
self.StartButton.SetText("Start")
self.StartButton.Show()
 
self.SlotButton = ui.Button()
self.SlotButton.SetParent(self)
self.SlotButton.SetPosition(225, 110)
self.SlotButton.SetUpVisual("d:/ymir work/ui/public/Large_Button_01.sub")
self.SlotButton.SetOverVisual("d:/ymir work/ui/public/Large_Button_01.sub")
self.SlotButton.SetDownVisual("d:/ymir work/ui/public/Large_Button_01.sub")
self.SlotButton.SetText("Slot")
self.SlotButton.Show() 
 
def LoadTextLines(self):
self.LastChangeText = ui.TextLine()
self.LastChangeText.SetParent(self)
self.LastChangeText.SetDefaultFontName()
self.LastChangeText.SetPosition(220, 142)
self.LastChangeText.SetFeather()
self.LastChangeText.SetText("Ostatnia zmiana:")
self.LastChangeText.SetFontColor(0.6, 0.7, 1)
self.LastChangeText.SetOutline()
self.LastChangeText.Show() 
 
self.LastChange = ui.TextLine()
self.LastChange.SetParent(self)
self.LastChange.SetDefaultFontName()
self.LastChange.SetPosition(220, 165)
self.LastChange.SetFeather()
self.LastChange.SetText("Nic nowego")
self.LastChange.SetFontColor(1.0, 1.0, 1.0)
self.LastChange.SetOutline()
self.LastChange.Show() 
 
self.SlotwahlText = ui.TextLine()
self.SlotwahlText.SetParent(self)
self.SlotwahlText.SetPosition(15 + 112 + 201, 110)
self.SlotwahlText.SetFeather()
self.SlotwahlText.SetDefaultFontName()
self.SlotwahlText.SetText("Slot:")
self.SlotwahlText.SetFontColor(1.0, 1.0, 1.0)
self.SlotwahlText.SetOutline()
self.SlotwahlText.Show() 
 
self.BonusValue1Text = ui.TextLine()
self.BonusValue1Text.SetParent(self)
self.BonusValue1Text.SetPosition(15 + 92, 44)
self.BonusValue1Text.SetFeather()
self.BonusValue1Text.SetDefaultFontName()
self.BonusValue1Text.SetText("Min. wartość:")
self.BonusValue1Text.SetFontColor(1.0, 1.0, 1.0)
self.BonusValue1Text.SetOutline()
self.BonusValue1Text.Show() 
 
self.BonusValue2Text = ui.TextLine()
self.BonusValue2Text.SetParent(self)
self.BonusValue2Text.SetPosition(15 + 92, 79)
self.BonusValue2Text.SetFeather()
self.BonusValue2Text.SetDefaultFontName()
self.BonusValue2Text.SetText("Min. wartość:")
self.BonusValue2Text.SetFontColor(1.0, 1.0, 1.0)
self.BonusValue2Text.SetOutline()
self.BonusValue2Text.Show() 
 
self.BonusHeadline = ui.TextLine()
self.BonusHeadline.SetParent(self)
self.BonusHeadline.SetDefaultFontName()
self.BonusHeadline.SetPosition(18, 142)
self.BonusHeadline.SetFeather()
self.BonusHeadline.SetText("Wybrane bony:")
self.BonusHeadline.SetFontColor(0.6, 0.7, 1)
self.BonusHeadline.SetOutline()
self.BonusHeadline.Show() 
 
self.Bonus1Attr = ui.TextLine()
self.Bonus1Attr.SetParent(self)
self.Bonus1Attr.SetDefaultFontName()
self.Bonus1Attr.SetPosition(18, 157 + 13*0)
self.Bonus1Attr.SetFeather()
self.Bonus1Attr.SetText("-")
self.Bonus1Attr.SetFontColor(1.0, 1.0, 1.0)
self.Bonus1Attr.SetOutline()
self.Bonus1Attr.Show() 
 
self.Bonus1Var = ui.TextLine()
self.Bonus1Var.SetParent(self)
self.Bonus1Var.SetDefaultFontName()
self.Bonus1Var.SetPosition(168, 157 + 13*0)
self.Bonus1Var.SetFeather()
self.Bonus1Var.SetText("0")
self.Bonus1Var.SetFontColor(1.0, 1.0, 1.0)
self.Bonus1Var.SetOutline()
self.Bonus1Var.Show() 
 
self.Bonus2Attr = ui.TextLine()
self.Bonus2Attr.SetParent(self)
self.Bonus2Attr.SetDefaultFontName()
self.Bonus2Attr.SetPosition(18, 157 + 13*1)
self.Bonus2Attr.SetFeather()
self.Bonus2Attr.SetText("-")
self.Bonus2Attr.SetFontColor(1.0, 1.0, 1.0)
self.Bonus2Attr.SetOutline()
self.Bonus2Attr.Show() 
 
self.Bonus2Var = ui.TextLine()
self.Bonus2Var.SetParent(self)
self.Bonus2Var.SetDefaultFontName()
self.Bonus2Var.SetPosition(168, 157 + 13*1)
self.Bonus2Var.SetFeather()
self.Bonus2Var.SetText("0")
self.Bonus2Var.SetFontColor(1.0, 1.0, 1.0)
self.Bonus2Var.SetOutline()
self.Bonus2Var.Show() 
 
def __BreakSwitching(self):
global SwitchButton
if SwitchButton == 1:
self.LastChange.SetText("Działanie zostało przerwane")
self.Switchtingabbruchbutton.SetText("Anuluj")
SwitchButton = 0 
else:
self.Hide()
 
def StartSwitchBot(self):
global SwitchButton
SwitchButton = 1 
self.LastChange.SetText("Zmieniacz wystartował.")
self.Switchtingabbruchbutton.SetText("Zatrzymaj zmieniacza.")
self.__Switchtingdialog()
 
def __Switchtingdialog(self):
global BoniSwitchvalue
global Bonus0
global Bonus1
global Bonus2
global Bonus3
global Bonus4
global SwitchButton
Slot = self.Slotbar.GetText()
val0, bon0 = player.GetItemAttribute((int(Slot)), 0) #(itemposition, atrribute)
val1, bon1 = player.GetItemAttribute((int(Slot)), 1) #(itemposition, atrribute)
val2, bon2 = player.GetItemAttribute((int(Slot)), 2) #(itemposition, atrribute)
val3, bon3 = player.GetItemAttribute((int(Slot)), 3) #(itemposition, atrribute)
val4, bon4 = player.GetItemAttribute((int(Slot)), 4) #(itemposition, atrribute)
Switchvalue = Boniswitchvalue
Search0 = self.Bvalue1.GetText()
Search1 = self.Bvalue2.GetText()
DELAY_SEC = self.TimerValue.GetText()
 
#1 Bonus switchen:
if SwitchButton == 1:
if (int(Bonus1) == 0) and (val0 == int(Bonus0) and bon0 >= int(Search0) or (val1 == int(Bonus0) and bon1 >= int(Search0)) or (val2 == int(Bonus0) and bon2 >= int(Search0)) or (val3 == int(Bonus0) and bon3 >= int(Search0)) or (val4 == int(Bonus0) and bon4 >= int(Search0))):
self.BoardMessage.SetTip("Bonusy zostały zmienione")
self.BoardMessage.SetTop()
self.LastChange.SetText("Bonusy zostały zmienione")
self.Switchtingabbruchbutton.SetText("Anuluj")
SwitchButton = 0 
#2 Bonis switchen:
elif (int(Bonus2) == 0) and (val0 == int(Bonus0) and bon0 >= int(Search0) or (val1 == int(Bonus0) and bon1 >= int(Search0)) or (val2 == int(Bonus0) and bon2 >= int(Search0)) or (val3 == int(Bonus0) and bon3 >= int(Search0)) or (val4 == int(Bonus0) and bon4 >= int(Search0))) and ((val0 == int(Bonus1) and bon0 >= int(Search1)) or (val1 == int(Bonus1) and bon1 >= int(Search1)) or (val2 == int(Bonus1) and bon2 >= int(Search1)) or (val3 == int(Bonus1) and bon3 >= int(Search1)) or (val4 == int(Bonus1) and bon4 >= int(Search1))):
self.BoardMessage.SetTip("Bonusy zostały zmienione")
self.BoardMessage.SetTop()
self.LastChange.SetText("Bonusy zostały zmienione")
self.Switchtingabbruchbutton.SetText("Anuluj")
SwitchButton = 0 
#3 Bonis switchen:
elif (int(Bonus3) == 0) and (val0 == int(Bonus0) and bon0 >= int(Search0) or (val1 == int(Bonus0) and bon1 >= int(Search0)) or (val2 == int(Bonus0) and bon2 >= int(Search0)) or (val3 == int(Bonus0) and bon3 >= int(Search0)) or (val4 == int(Bonus0) and bon4 >= int(Search0))) and ((val0 == int(Bonus1) and bon0 >= int(Search1)) or (val1 == int(Bonus1) and bon1 >= int(Search1)) or (val2 == int(Bonus1) and bon2 >= int(Search1)) or (val3 == int(Bonus1) and bon3 >= int(Search1)) or (val4 == int(Bonus1) and bon4 >= int(Search1))) and ((val0 == int(Bonus2) and bon0 >= int(Search2)) or (val1 == int(Bonus2) and bon1 >= int(Search2)) or (val2 == int(Bonus2) and bon2 >= int(Search2)) or (val3 == int(Bonus2) and bon3 >= int(Search2)) or (val4 == int(Bonus2) and bon4 >= int(Search2))):
self.BoardMessage.SetTip("Bonusy zostały zmienione")
self.BoardMessage.SetTop()
self.LastChange.SetText("Bonusy zostały zmienione")
self.Switchtingabbruchbutton.SetText("Anuluj")
SwitchButton = 0 
#4 Bonis switchen:
elif (int(Bonus4) == 0) and (val0 == int(Bonus0) and bon0 >= int(Search0) or (val1 == int(Bonus0) and bon1 >= int(Search0)) or (val2 == int(Bonus0) and bon2 >= int(Search0)) or (val3 == int(Bonus0) and bon3 >= int(Search0)) or (val4 == int(Bonus0) and bon4 >= int(Search0))) and ((val0 == int(Bonus1) and bon0 >= int(Search1)) or (val1 == int(Bonus1) and bon1 >= int(Search1)) or (val2 == int(Bonus1) and bon2 >= int(Search1)) or (val3 == int(Bonus1) and bon3 >= int(Search1)) or (val4 == int(Bonus1) and bon4 >= int(Search1))) and ((val0 == int(Bonus2) and bon0 >= int(Search2)) or (val1 == int(Bonus2) and bon1 >= int(Search2)) or (val2 == int(Bonus2) and bon2 >= int(Search2)) or (val3 == int(Bonus2) and bon3 >= int(Search2)) or (val4 == int(Bonus2) and bon4 >= int(Search2))) and ((val0 == int(Bonus3) and bon0 >= int(Search3)) or (val1 == int(Bonus3) and bon1 >= int(Search3)) or (val2 == int(Bonus3) and bon2 >= int(Search3)) or (val3 == int(Bonus3) and bon3 >= int(Search3)) or (val4 == int(Bonus3) and bon4 >= int(Search3))):
self.BoardMessage.SetTip("Bonusy zostały zmienione")
self.BoardMessage.SetTop()
self.LastChange.SetText("Bonusy zostały zmienione")
self.Switchtingabbruchbutton.SetText("Anuluj")
SwitchButton = 0 
#5 Bonis switchen:
elif (int(Bonus4) != 0) and (val0 == int(Bonus0) and bon0 >= int(Search0) or (val1 == int(Bonus0) and bon1 >= int(Search0)) or (val2 == int(Bonus0) and bon2 >= int(Search0)) or (val3 == int(Bonus0) and bon3 >= int(Search0)) or (val4 == int(Bonus0) and bon4 >= int(Search0))) and ((val0 == int(Bonus1) and bon0 >= int(Search1)) or (val1 == int(Bonus1) and bon1 >= int(Search1)) or (val2 == int(Bonus1) and bon2 >= int(Search1)) or (val3 == int(Bonus1) and bon3 >= int(Search1)) or (val4 == int(Bonus1) and bon4 >= int(Search1))) and ((val0 == int(Bonus2) and bon0 >= int(Search2)) or (val1 == int(Bonus2) and bon1 >= int(Search2)) or (val2 == int(Bonus2) and bon2 >= int(Search2)) or (val3 == int(Bonus2) and bon3 >= int(Search2)) or (val4 == int(Bonus2) and bon4 >= int(Search2))) and ((val0 == int(Bonus3) and bon0 >= int(Search3)) or (val1 == int(Bonus3) and bon1 >= int(Search3)) or (val2 == int(Bonus3) and bon2 >= int(Search3)) or (val3 == int(Bonus3) and bon3 >= int(Search3)) or (val4 == int(Bonus3) and bon4 >= int(Search3))) and ((val0 == int(Bonus4) and bon0 >= int(Search4)) or (val1 == int(Bonus4) and bon1 >= int(Search4)) or (val2 == int(Bonus4) and bon2 >= int(Search4)) or (val3 == int(Bonus4) and bon3 >= int(Search4)) or (val4 == int(Bonus4) and bon4 >= int(Search4))):
self.BoardMessage.SetTip("Bonusy zostały zmienione")
self.BoardMessage.SetTop()
self.LastChange.SetText("Bonusy zostały zmienione")
self.Switchtingabbruchbutton.SetText("Anuluj")
SwitchButton = 0 
elif Bonus0 == 0:
self.Switchtingabbruchbutton.SetText("Anuluj")
SwitchButton = 0 
self.LastChange.SetText("Działanie zostało przerwane")
chat.AppendChat(chat.CHAT_TYPE_INFO, "Proszę wpisać minimalną wartość bonusu") 
chat.AppendChat(chat.CHAT_TYPE_INFO, "aby porwanie wszystko działało!") 
else:
self.WaitingDelay = WaitingDialog()
self.WaitingDelay.Open(float(DELAY_SEC))
self.WaitingDelay.SAFE_SetTimeOverEvent(self.__Switchtingdialog)
for eachSlot in xrange(player.INVENTORY_PAGE_SIZE*4):
itemVNum = player.GetItemIndex(eachSlot)
 
if itemVNum == int(Switchvalue):
net.SendItemUseToItemPacket(eachSlot, (int(Slot)))
break
if player.GetItemCountByVnum(int(Switchvalue)) <= 1:
for eachSlot in xrange(shop.SHOP_SLOT_COUNT):
getShopItemID = shop.GetItemID(eachSlot)
if getShopItemID == int(Switchvalue) and not itemVNum == int(Switchvalue):
net.SendShopBuyPacket(eachSlot)
 
def __Resetbonusall(self):
global Bonus0
global Bonus1
global Bonus2
global Bonus3
global Bonus4
Bonus0 = 0
Bonus1 = 0
Bonus2 = 0
Bonus3 = 0
Bonus4 = 0
self.Bvalue1.SetText("0")
self.Bvalue2.SetText("0")
self.Bonus1Attr.SetText("-")
self.Bonus2Attr.SetText("-")
self.LastChange.SetText("Usunąłem zapisane bony.")
 
def __Wish_1_Option(self):
global Bonus0
global PRESSWISH0
PRESSWISH0 = 1
self.BonusListBox = FileListDialog()
 
def __Wish_2_Option(self):
global Bonus1
global PRESSWISH1
PRESSWISH1 = 1
self.BonusListBox = FileListDialog()
 
def __Wish_3_Option(self):
global Bonus2
global PRESSWISH2
PRESSWISH2 = 1
self.BonusListBox = FileListDialog()
 
def __Wish_4_Option(self):
global Bonus3
global PRESSWISH3
PRESSWISH3 = 1
self.BonusListBox = FileListDialog()
 
def __Wish_5_Option(self):
global Bonus4
global PRESSWISH4
PRESSWISH4 = 1
self.BonusListBox = FileListDialog()
 
def OnUpdate(self):
global Bonus0
global Bonus1
if self.Bonus1Attr.GetText() != str(BonusListe[int(Bonus0)-71]) and int(Bonus0) != 0:
self.Bonus1Attr.SetText(str(BonusListe[int(Bonus0)-71]))
elif self.Bonus1Attr.GetText() != "" and int(Bonus0) == 0:
self.Bonus1Attr.SetText("-")
if self.Bonus2Attr.GetText() != str(BonusListe[int(Bonus1)-71]) and int(Bonus1) != 0:
self.Bonus2Attr.SetText(str(BonusListe[int(Bonus1)-71]))
elif self.Bonus2Attr.GetText() != "" and int(Bonus1) == 0:
self.Bonus2Attr.SetText("-") 
 
if self.Bonus1Var.GetText() != self.Bvalue1.GetText():
self.Bonus1Var.SetText(str(self.Bvalue1.GetText()))
if self.Bonus2Var.GetText() != self.Bvalue2.GetText():
self.Bonus2Var.SetText(str(self.Bvalue2.GetText()))
 
def Show(self):
ui.BoardWithTitleBar.Show(self)
 
def Close(self):
self.Hide()
return TRUE
 
def OnPressEscapeKey(self):
self.Hide()
return TRUE
 
BonusListe = ( 
"Umiejętności",
"Średnie obrażenia",
)
 
BonusIDListe = { 
"Umiejętności" : 71,
"Średnie obrażenia" : 72,
}
 
class FileListDialog(ui.BoardWithTitleBar):
def __init__(self):
ui.BoardWithTitleBar.__init__(self)
 
self.isLoaded=0
self.selectEvent=None
self.fileListBox=None
 
self.SetCenterPosition()
self.SetSize(300, 350)
self.Show()
self.SetTitleName("Wybierz bonus:")
self.AddFlag("movable")
self.AddFlag("float")
 
def __del__(self):
ui.BoardWithTitleBar.__del__(self)
 
def Show(self):
if self.isLoaded==0:
self.isLoaded=1
 
self.__Load()
 
ui.BoardWithTitleBar.Show(self)
 
def Open(self):
self.Show()
 
self.SetCenterPosition()
self.SetTop()
self.UpdateFileList()
 
def Close(self):
self.Hide()
 
def OnPressEscapeKey(self):
self.Close()
return TRUE
 
def __CreateFileListBox(self):
fileListBox = ui.ListBoxEx()
fileListBox.SetParent(self)
fileListBox.SetPosition(30, 70)
fileListBox.Show()
return fileListBox
 
def __Load(self):
self.__Load_BindObject()
 
self.UpdateFileList()
 
def __Load_BindObject(self):
self.fileListBox = self.__CreateFileListBox()
self.LoadFuckingScrollBar()
self.fileListBox.SetScrollBar(self.ScrollBar)
 
self.UpdateButton = ui.Button()
self.UpdateButton.SetParent(self)
self.UpdateButton.SetUpVisual("d:/ymir work/ui/public/Large_button_01.sub")
self.UpdateButton.SetOverVisual("d:/ymir work/ui/public/Large_button_02.sub")
self.UpdateButton.SetDownVisual("d:/ymir work/ui/public/Large_button_03.sub")
self.UpdateButton.SetText("Aktualizacja")
self.UpdateButton.SetPosition(15, 265)
self.UpdateButton.SetEvent(ui.__mem_func__(self.UpdateFileList))
self.UpdateButton.Show()
self.UpdateButton.Hide()
 
self.SelectBonus = ui.Button()
self.SelectBonus.SetParent(self)
self.SelectBonus.SetPosition(50, 290)
self.SelectBonus.SetUpVisual("d:/ymir work/ui/public/Middle_Button_01.sub")
self.SelectBonus.SetOverVisual("d:/ymir work/ui/public/Middle_Button_02.sub")
self.SelectBonus.SetDownVisual("d:/ymir work/ui/public/Middle_Button_03.sub")
self.SelectBonus.SetText("OK")
self.SelectBonus.SetEvent(ui.__mem_func__(self.SetBonis))
self.SelectBonus.Show()
 
self.CancelBonus = ui.Button()
self.CancelBonus.SetParent(self)
self.CancelBonus.SetPosition(180, 290)
self.CancelBonus.SetUpVisual("d:/ymir work/ui/public/Middle_Button_01.sub")
self.CancelBonus.SetOverVisual("d:/ymir work/ui/public/Middle_Button_02.sub")
self.CancelBonus.SetDownVisual("d:/ymir work/ui/public/Middle_Button_03.sub")
self.CancelBonus.SetText("Wyjdź")
self.CancelBonus.SetEvent(ui.__mem_func__(self.Close))
self.CancelBonus.Show()
 
def LoadFuckingScrollBar(self):
self.ScrollBar = ui.ScrollBar()
self.ScrollBar.SetParent(self)
self.ScrollBar.SetPosition(260, 40)
self.ScrollBar.SetScrollBarSize(250)
self.ScrollBar.Show()
 
def CancelGuildName(self):
sself.GuildNameBoard.Close()
sself.GuildNameBoard = None
return TRUE
 
def UpdateFileList(self):
self.__RefreshFileList()
for BonusType in BonusListe:
if BonusType == "":
self.fileListBox.AppendItem(Item("-----"))
elif BonusType != "":
self.fileListBox.AppendItem(Item(BonusType))
#chat.AppendChat(chat.CHAT_TYPE_INFO, str(BonusIDListe[BonusType])) 
 
def __RefreshFileList(self):
self.fileListBox.RemoveAllItems()
 
def SetBonis(self):
global Bonus0
global Bonus1
global Bonus2
global Bonus3
global Bonus4
global PRESSWISH0
global PRESSWISH1
global PRESSWISH2
global PRESSWISH3
global PRESSWISH4
SelectedIndex = self.fileListBox.GetSelectedItem()
SelectedIndex = SelectedIndex.GetText()
if str(SelectedIndex) != "keiner" and str(SelectedIndex) != "":
if PRESSWISH0 == 1:
chat.AppendChat(chat.CHAT_TYPE_INFO, "1.Wybrano bonus: " + str(SelectedIndex))
Bonus0 = BonusIDListe[str(SelectedIndex)]
PRESSWISH0 = 0
elif PRESSWISH1 == 1:
chat.AppendChat(chat.CHAT_TYPE_INFO, "2.Wybrano bonus: " + str(SelectedIndex))
Bonus1 = int(BonusIDListe[SelectedIndex])
PRESSWISH1 = 0
elif PRESSWISH2 == 1:
chat.AppendChat(chat.CHAT_TYPE_INFO, "3.Wybrano bonus: " + str(SelectedIndex))
Bonus2 = int(BonusIDListe[SelectedIndex])
PRESSWISH2 = 0
elif PRESSWISH3 == 1:
chat.AppendChat(chat.CHAT_TYPE_INFO, "4.Wybrano bonus: " + str(SelectedIndex))
Bonus3 = int(BonusIDListe[SelectedIndex])
PRESSWISH3 = 0
elif PRESSWISH4 == 1:
chat.AppendChat(chat.CHAT_TYPE_INFO, "5.Wybrano bonus: " + str(SelectedIndex))
Bonus4 = int(BonusIDListe[SelectedIndex])
PRESSWISH4 = 0
 
elif str(SelectedIndex) == "keiner" and str(SelectedIndex) != "":
if PRESSWISH0 == 1:
chat.AppendChat(chat.CHAT_TYPE_INFO, "1.Bonus zostal usuniety")
Bonus0 = 0
PRESSWISH0 = 0
elif PRESSWISH1 == 1:
chat.AppendChat(chat.CHAT_TYPE_INFO, "2.Bonus zostal usuniety")
Bonus1 = 0
PRESSWISH1 = 0
elif PRESSWISH2 == 1:
chat.AppendChat(chat.CHAT_TYPE_INFO, "3.Bonus zostal usuniety")
Bonus2 = 0
PRESSWISH2 = 0
elif PRESSWISH3 == 1:
chat.AppendChat(chat.CHAT_TYPE_INFO, "4.Bonus zostal usuniety")
Bonus3 = 0
PRESSWISH3 = 0
elif PRESSWISH4 == 1:
chat.AppendChat(chat.CHAT_TYPE_INFO, "5.Bonus zostal usuniety")
Bonus4 = 0
PRESSWISH4 = 0 
 
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Bonus nie jest wybrany") 
self.Close()
 
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
 
FILE_NAME_LEN = 40 
 
class Item(ui.ListBoxEx.Item):
def __init__(self, fileName):
ui.ListBoxEx.Item.__init__(self)
self.canLoad=0
self.text=fileName
self.textLine=self.__CreateTextLine(fileName[:FILE_NAME_LEN])          
 
def __del__(self):
ui.ListBoxEx.Item.__del__(self)
 
def GetText(self):
return self.text
 
def SetSize(self, width, height):
ui.ListBoxEx.Item.SetSize(self, 6*len(self.textLine.GetText()) + 4, height)
 
def __CreateTextLine(self, fileName):
textLine=ui.TextLine()
textLine.SetParent(self)
textLine.SetPosition(0, 0)
textLine.SetText(fileName)
textLine.Show()
return textLine
 

 

 

CPU: i5 2500k @4,8GHz 

COOLER: SilentiumPC Spartan Pro 

MOBO: Gigabyte P67-A-D3-B3 

RAM: Samsung 8GB @1333MHz 

GPU: Palit GTX750Ti StormX Dual 2GB @1281Mhz/3004Mhz

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...