### Hier die Boni angeben, die auf dem Server aktiviert sind. Die angegebene Liste ist nur ein Beispiel und MUSS angepasst werden!
BONI_AVAIL = [1,3,4,5,6,9,10,15,16,17,29,30,31,32,33,34,35,36,37,38,41,48,53,39,27,28,12]
# Hier 6/7 Boni angeben!
BONI_RARE_AVAIL = [1,3,4,5,6]
# Das Switch-Item
SWITCH_VNUM = 71084
SWITCH_RARE_VNUM = 71052
# Die folgenden zahlen geben den MINMAX Bereich des Reglers an, der die Zeit angibt.
MIN_SWITCH_DELAY = 35
MAX_SWITCH_DELAY_APPEND = 120
def enable_rare_boni(self):
for i in range(0,4):
self.boni[6][i].Show()
self.boni[7][i].Show()
self.Starter.SetPosition(0,140+45)
self.bg_rare_boni.Show()
self.bg_rare_boni_but.Show()
self.Starter_rare_boni.Show()
self.sub_parent.StatusBar_rare.Show()
if self.sub_parent.parentWindow.parentWindow.gameWindow != None:
self.sub_parent.blockBar.Enable_rare(1)
def disable_rare_boni(self):
for i in range(0,4):
self.boni[6][i].Hide()
self.boni[7][i].Hide()
self.Starter.SetPosition(0,140)
self.bg_rare_boni.Hide()
self.bg_rare_boni_but.Hide()
self.Starter_rare_boni.Hide()
self.sub_parent.StatusBar_rare.Hide()
self.Deactivate_rare()
if self.sub_parent.parentWindow.parentWindow.gameWindow != None:
self.sub_parent.blockBar.Enable_rare(0)
for i in range(7,5,-1):
vas = i
self.boni[vas] = {}
self.boni[vas][0] = ui.TextLine()
self.boni[vas][0].SetParent(self)
self.boni[vas][0].SetText("Bonus "+str(vas))
self.boni[vas][0].SetPosition(15,10+25*(vas-1))
self.boni[vas][0].Hide()
self.boni[vas][1] = DropDown(self,"- Keiner -")
self.boni[vas][1].SetPosition(70,10+25*(vas-1))
for x in AFFECT_DICT:
if x in BONI_RARE_AVAIL:
self.boni[vas][1].AppendItem(str(AFFECT_DICT[x](0)),x)
self.boni[vas][1].SetSize(330,20)
self.boni[vas][1].Hide()
self.boni[vas][2] = ui.Bar("UI")
self.boni[vas][2].SetParent(self)
self.boni[vas][2].SetPosition(410,10+25*(vas-1))
self.boni[vas][2].SetColor(0xC0000000)
self.boni[vas][2].SetSize(80,20)
self.boni[vas][2].Hide()
self.boni[vas][3] = Edit2("0",14)
self.boni[vas][3].SetParent(self.boni[vas][2])
self.boni[vas][3].SetNumberMode()
self.boni[vas][3].SetSize(80,20)
self.boni[vas][3].SetPosition(4,3)
self.boni[vas][3].Hide()
for i in range(0,5):
vas = 5-i
self.boni[vas] = {}
self.boni[vas][0] = ui.TextLine()
self.boni[vas][0].SetParent(self)
self.boni[vas][0].SetText("Bonus "+str(vas))
self.boni[vas][0].SetPosition(15,10+25*(vas-1))
self.boni[vas][0].Show()
self.boni[vas][1] = DropDown(self,"- Keiner -")
self.boni[vas][1].SetPosition(70,10+25*(vas-1))
for x in AFFECT_DICT:
if x in BONI_AVAIL:
self.boni[vas][1].AppendItem(str(AFFECT_DICT[x](0)),x)
self.boni[vas][1].SetSize(330,20)
self.boni[vas][1].Show()
self.boni[vas][2] = ui.Bar("UI")
self.boni[vas][2].SetParent(self)
self.boni[vas][2].SetPosition(410,10+25*(vas-1))
self.boni[vas][2].SetColor(0xC0000000)
self.boni[vas][2].SetSize(80,20)
self.boni[vas][2].Show()
self.boni[vas][3] = Edit2("0",14)
self.boni[vas][3].SetParent(self.boni[vas][2])
self.boni[vas][3].SetNumberMode()
self.boni[vas][3].SetSize(80,20)
self.boni[vas][3].SetPosition(4,3)
self.boni[vas][3].Show()
self.BlockText = ui.TextLine()
self.BlockText.SetParent(self.BlockBar)
self.BlockText.SetWindowHorizontalAlignCenter()
self.BlockText.SetHorizontalAlignCenter()
self.BlockText.SetPosition(0,140)
self.BlockText.SetText("Dieses Item kannst du nicht switchen.")
self.BlockText.Show()
self.prepare_propose()
def change_boni(self):
use = self.but_propose.DropList.GetSelectedItem().value
bon = 1
item.SelectItem(self.sub_parent.vnum)
for x in use:
# TODO: Check if bonus exists on item!!
ok = 1
for i in xrange(item.ITEM_APPLY_MAX_NUM):
(affectType, affectValue) = item.GetAffect(i)
if affectType == x[0]:
ok = 0
if ok == 0:
continue
y = self.boni[bon][1]
y.SelectByAffectId(x[0])
self.boni[bon][1].act.SetText(y.DropList.GetSelectedItem().textBox.GetText())
self.boni[bon][3].SetText(str(x[1]))
bon+=1
for x in range(bon,6):
y = self.boni[x][1].DropList
y.SelectIndex(0)
self.boni[x][1].act.SetText(y.GetSelectedItem().textBox.GetText())
self.boni[x][3].SetText("0")
# last_switch = -1
rebuyed = 0
def nachkauf(self):
if self.parentWindow.parentWindow.buyed != 0:
return
else:
self.parentWindow.parentWindow.buyed = 1
if self.parentWindow.parentWindow.enable_rebuy.checked == 1:
for i in range(0,shop.SHOP_SLOT_COUNT):
me = shop.GetItemID(i)
if me == SWITCH_VNUM:
if shop.GetItemPrice(i) > player.GetMoney():
# chat.AppendChat(1,"-- Switchitem gefunden! Aber wir haben kein Geld :(")
self.bonusSelector.Deactivate()
return
else:
net.SendShopBuyPacket(i)
self.rebuyed = 1
# self.Switch()
return
rebuyed_rare = 0
def nachkauf_rare(self):
if self.parentWindow.parentWindow.buyed_rare != 0:
return
else:
self.parentWindow.parentWindow.buyed_rare = 1
if self.parentWindow.parentWindow.enable_rebuy.checked == 1:
for i in range(0,shop.SHOP_SLOT_COUNT):
me = shop.GetItemID(i)
if me == SWITCH_RARE_VNUM:
if shop.GetItemPrice(i) > player.GetMoney():
# chat.AppendChat(1,"-- Switchitem gefunden! Aber wir haben kein Geld :(")
self.bonusSelector.Deactivate_rare()
return
else:
net.SendShopBuyPacket(i)
self.rebuyed_rare = 1
# self.Switch()
return
# self.bonusSelector.Deactivate()
def Switch_rare(self):
lc = 0
for i in range(0,90*2):
if player.GetItemIndex(i) == SWITCH_RARE_VNUM:
lc+=player.GetItemCount(i)
if lc == 0 and self.parentWindow.parentWindow.enable_rebuy.checked == 0:
chat.AppendChat(2,"Slot %d: 6/7 Switchen abgebrochen -> Keine Switchitems & Nachkauf war nicht erfolgreich!" % (self.index+1))
self.bonusSelector.Deactivate_rare()
return
if lc < 15:
self.nachkauf_rare()
if lc == 0:
self.bonusSelector.Deactivate_rare()
chat.AppendChat(2,"Slot %d: 6/7 Switchen abgebrochen -> Keine Switchitems!" % (self.index+1))
return
for i in range(0,90*2):
if player.GetItemIndex(i) == SWITCH_RARE_VNUM:
net.SendItemUseToItemPacket(i,self.index)
return
def Switch(self):
lc = 0
for i in range(0,90*2):
if player.GetItemIndex(i) == SWITCH_VNUM:
lc+=player.GetItemCount(i)
if lc == 0 and self.parentWindow.parentWindow.enable_rebuy.checked == 0:
self.bonusSelector.Deactivate()
return
if lc < 15:
self.nachkauf()
if lc == 0:
self.bonusSelector.Deactivate()
return
for i in range(0,90*2):
if player.GetItemIndex(i) == SWITCH_VNUM:
net.SendItemUseToItemPacket(i,self.index)
return
# self.nachkauf()
def checkSwitch(self):
ok = 0
for i in range(0,5):
if player.GetItemAttribute(self.index, i) != self.values[i]:
ok = 1
self.prob = self.GetProb()
self.StatusText.SetText("Aktiv (%d%%)" %self.prob)
if ok == 1 or self.prob >= 90:
if self.prob >= 90:
chat.AppendChat(1,"Slot %d: fertig geswitcht!" % (self.index+1))
self.bonusSelector.Finish()
return
self.values = [player.GetItemAttribute(self.index, i) for i in range(0,5)]
self.Switch()
elif self.rebuyed > 0:
self.rebuyed = 0
self.Switch()
elif ok == 0 and self.count < 5:
self.count+=1
elif ok == 0 and self.count >= 5:
self.count = 0
self.Switch()
# elif self.last_switch > -1 and player.GetItemCount(self.last_switch) == 0:
# chat.AppendChat(2,"%d"%player.GetItemCount(self.last_switch))
# self.last_switch = 0
# self.Switch()
# else:
# if self.GetProb() != 100:
# self.Switch()
pass
def checkSwitch_rare(self):
ok = 0
for i in range(0,2):
if player.GetItemAttribute(self.index, i+6) != self.values_rare[i]:
ok = 1
self.prob_rare = self.GetProb_rare()
self.StatusText_rare.SetText("Aktiv (%d%%)" %self.prob_rare)
if ok == 1 or self.prob_rare >= 90:
if self.prob_rare >= 90:
self.bonusSelector.Finish_rare()
chat.AppendChat(1,"Slot %d: 6/7 fertig geswitcht!" % (self.index+1))
return
self.values_rare = [player.GetItemAttribute(self.index, i) for i in range(5,7)]
self.Switch_rare()
elif self.rebuyed_rare > 0:
self.rebuyed_rare = 0
self.Switch_rare()
elif ok == 0 and self.count_rare < 5:
self.count_rare+=1
elif ok == 0 and self.count_rare >= 5:
self.count_rare = 0
self.Switch_rare()
if item.GetItemType() != 1 and item.GetItemType() != 2:
self.bonusSelector.Block()
else:
self.bonusSelector.Unblock()
self.ItemIcon.Show()
self.ItemIcon.LoadImage(item.GetIconImageFileName())
# self.values = [player.GetItemAttribute(self.index, i) for i in range(0,5)]
return
if self.IsActive():
self.checkSwitch()
if self.IsActive_rare():
self.checkSwitch_rare()
# except:
# pass
def SetIndex(self,index):
self.index = index
self.bonusSelector.index = index
self.bonusSelector.Starter.SetText("Switchen ("+str(index+1)+") starten")
self.Update()
self.UpdateItem()
def GetProb_rare(self):
values = [player.GetItemAttribute(self.index, i+6) for i in range(0,2)]
val2 = {}
for i in range(0,2):
try:
affectString = AFFECT_DICT[values[i][0]](values[i][1])
val2[values[i][0]] = values[i][1]
self.bonusSelector.ibi[i+6].SetText(affectString)
except:
pass
prob = 0
max = 0
yp = self.GenList_rare()
for x in yp:
if yp[x] in val2 and val2[yp[x]] >= int(self.bonusSelector.boni[x+5][3].GetText()):
prob = prob+1
max = max+1
if max > 0:
prozent = 100/max*prob
else:
prozent = 100
return prozent
pass
def GetProb(self):
values = [player.GetItemAttribute(self.index, i) for i in range(0,5)]
val2 = {}
# for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
for i in range(0,5):
try:
affectString = AFFECT_DICT[values[i][0]](values[i][1])
val2[values[i][0]] = values[i][1]
self.bonusSelector.ibi[i].SetText(affectString)
except:
pass
prob = 0
max = 0
yp = self.GenList()
for x in yp:
if yp[x] in val2 and val2[yp[x]] >= int(self.bonusSelector.boni[x][3].GetText()):
prob = prob+1
max = max+1
if max > 0:
prozent = 100/max*prob
else:
prozent = 100
return prozent
def GenList(self):
ret = {}
for i in range(0,5):
if self.bonusSelector.boni[5-i][1].selected.value != 0:
ret[5-i] = self.bonusSelector.boni[5-i][1].selected.value
return ret
def GenList_rare(self):
ret = {}
for i in range(0,2):
if self.bonusSelector.boni[6+i][1].selected.value != 0:
ret[i+1] = self.bonusSelector.boni[6+i][1].selected.value
return ret
def DeleteTab(self,id):
if self.parentWindow.gameWindow != None:
self.tabList[id].blockBar.Hide()
self.tabList[id].blockBar.Destroy()
self.tabList[id].Destroy()
# del self.tabList[id]
self.tabCount = self.tabCount -1
if self.tabCount > id and id < 5:
for i in xrange(id,self.tabCount):
self.tabList[i] = self.tabList[i+1]
self.tabList[i].tabnum = i
self.tabList[i].SetPosition((self.tabList[i].width+self.tabList[i].dist)*i,0)
item.SelectItem(attachedSlotVnum)
if item.GetItemType() != 1 and item.GetItemType() != 2:
mouseModule.mouseController.DeattachObject()
chat.AppendChat(2,"Dieses Item kannst du nicht switchen.")
return
for a in self.tabList:
if self.tabList[a].index == attachedSlotPos:
mouseModule.mouseController.DeattachObject()
chat.AppendChat(2,"Dieser Slot ist bereits eingefuegt worden!")
return
if player.SLOT_TYPE_INVENTORY == attachedSlotType:
self.AddTab(attachedSlotPos,attachedSlotVnum)
chat.AppendChat(2,"Item hinzugefuegt!")
class Bot(ui.BoardWithTitleBar):
class PinGroup(ui.Bar):
def OnUpdate(self):
## Now check position.
(x,y) = self.GetGlobalPosition()
max_x = wndMgr.GetScreenWidth()-self.GetWidth()
max_y = wndMgr.GetScreenHeight()-self.GetHeight()-DISTANCE_BOTTOM
if not x == self.pos_x or not y == self.pos_y:
old_dir = self.dir
if self.pos_x == 0 and not self.pos_y == 0 and not self.pos_y == max_y and old_dir != 1:
self.parse_dir(1)
elif self.pos_x == max_x and not self.pos_y == 0 and not self.pos_y == max_y and old_dir != 2:
self.parse_dir(2)
elif self.pos_y == max_y and not self.pos_x == 0 and not self.pos_x == max_x and old_dir != 4:
self.parse_dir(4)
elif self.pos_y == 0 and not self.pos_x == 0 and not self.pos_x == max_x and old_dir != 3:
self.parse_dir(3)
if self.pos_x == 0 and not self.pos_y == 0 and not self.pos_y == max_y:
x = 0
elif self.pos_x == max_x and not self.pos_y == 0 and not self.pos_y == max_y:
x = max_x
elif self.pos_y == 0 and not self.pos_x == 0 and not self.pos_x == max_x:
y = 0
elif self.pos_y == max_y and not self.pos_x == 0 and not self.pos_x == max_x:
y = max_y
if x > 0 and x < max_x and y > 0 and y < max_y:
if y < int(max_y/2):
y = 0
else:
y = max_y
if x < int(max_x/2):
x = 0
else:
x = max_x
x = min(max(0,x),wndMgr.GetScreenWidth()-self.GetWidth())
y = min(max(0,y),wndMgr.GetScreenHeight()-self.GetHeight()-DISTANCE_BOTTOM)
self.SetPosition(x,y)
self.pos_x = x
self.pos_y = y
# (self.pos_x,self.pos_y) = self.GetGlobalPosition()
self.parent.OnUpdate()
for c in self.txtlist:
c.SetColor(c.item.StatusBar.color)
c.txt2.SetText("Status: %s" % c.item.StatusText.GetText())
try:
c.listWin2.SetColor(c.item.StatusBar_rare.color)
c.txt3.SetText("Status: %s" % c.item.StatusText_rare.GetText())
except:
pass
def ShowMainWindow(self):
(x,y) = self.parent.GetGlobalPosition()
x = min(max(32,x),wndMgr.GetScreenWidth()-self.parent.GetWidth()-32)
y = min(max(32,y),wndMgr.GetScreenHeight()-self.parent.GetHeight()-DISTANCE_BOTTOM-32)
self.parent.SetPosition(x,y)
self.parent.Show()
self.__del__()
def parse_dir(self,dir):
self.dir = dir
w,h = 100,50
for listWin in self.txtlist:
itm = listWin.item
listWin.AddFlag("not_pick")
if dir >= 3:
listWin.SetPosition(w,4)
listWin.SetSize(90,h-8)
w+=92
if itm.bonusSelector.EnableRareBoni.checked == 1:
w+=15
listWin.SetSize(105,4+12+12)
listWin.listWin2.SetSize(105,14)
listWin.listWin2.Show()
listWin.txt3.Show()
else:
listWin.SetPosition(0,h)
listWin.SetSize(w,4+12+12+2)
self.help_add_item = HelpBar(0.8,'Ziehe ein Item hierher, um es hinzuzufuegen.')
self.help_add_item.SetParent(self)
self.help_add_item.SetPosition(60,50)
self.help_minimize = HelpBar(0.8,'Ziehe den Bot an den Rand, um ihn zu verkleinern!',1)
self.help_minimize.SetParent(self.titleBar)
self.help_minimize.SetWindowHorizontalAlignCenter()
self.help_minimize.SetPosition(100,-30)
self.help_show_rare = HelpBar(0.85,'Hiermit kannst du die Anzeige von 6/7 Boni umschalten.')
self.help_show_rare.SetParent(self)
# self.help_show_rare.SetPosition(35,312)
self.help_rebuy = HelpBar(0.5,'Soll der Bot nachkaufen?')
self.help_rebuy.SetParent(self)
# self.help_rebuy.SetPosition(25,297)
self.help_stop_all = HelpBar(0.8,'Stop ALLE Vorgaenge!',1)
self.help_stop_all.SetParent(self.titleBar)
self.help_stop_all.SetPosition(3+5+self.titleBar.HelpBut.GetWidth()*1.2,-30)
self.help_duration = HelpBar(0.8,'Verlangsamt den Bot.',1)
self.help_duration.SetParent(self)
def deactivate_all(self):
for a in self.itemTabBar.tabList:
self.itemTabBar.tabList[a].bonusSelector.Starter.SetUp()
self.itemTabBar.tabList[a].bonusSelector.Starter.OnToggleUp()
self.itemTabBar.tabList[a].bonusSelector.Starter_rare_boni.SetUp()
self.itemTabBar.tabList[a].bonusSelector.Starter_rare_boni.OnToggleUp()
pass
if self.gameWindow != None:
for a in self.itemTabBar.tabList:
itm = self.itemTabBar.tabList[a]
self.counter+=1
if self.counter >= int(self.but_speed.GetSliderPos()*MAX_SWITCH_DELAY_APPEND+MIN_SWITCH_DELAY):
self.buyed = 0
self.buyed_rare = 0
self.counter = 0
for a in self.itemTabBar.tabList:
itm = self.itemTabBar.tabList[a]
itm.UpdateItem()
# if itm.
self.AboutWindow.text2 = ui.TextLine()
self.AboutWindow.text2.SetParent(self.AboutWindow)
self.AboutWindow.text2.SetPosition(8,18)
self.AboutWindow.text2.SetText("Dieser Switchbot wurde von Mijago entwickelt.")
self.AboutWindow.text2.Show()
self.AboutWindow.text3 = ui.TextLine()
self.AboutWindow.text3.SetParent(self.AboutWindow)
self.AboutWindow.text3.SetPosition(8,18+13)
self.AboutWindow.text3.SetText("Neue Ideen werden immer gerne gesehen!")
self.AboutWindow.text3.Show()
self.AboutWindow.text4 = ui.TextLine()
self.AboutWindow.text4.SetParent(self.AboutWindow)
self.AboutWindow.text4.SetPosition(8,18+13*3)
self.AboutWindow.text4.SetText("Ich bitte euch, diesen Bot nicht ohne meine")
self.AboutWindow.text4.Show()
self.AboutWindow.text5 = ui.TextLine()
self.AboutWindow.text5.SetParent(self.AboutWindow)
self.AboutWindow.text5.SetPosition(8,18+13*4)
self.AboutWindow.text5.SetText("Genehmigung zu nutzen.")
self.AboutWindow.text5.Show()
def SetPosition(self,w,h):
ui.Window.SetPosition(self,w,h)
if self.down == 1:
self.Drop.SetPosition(w,h+21)
else:
self.Drop.SetPosition(w,h-self.Drop.GetHeight())
def SetSize(self,w,h):
ui.Window.SetSize(self,w,h)
self.bg.SetSize(w,h)
self.Drop.SetSize(w,0)
self.DropList.SetSize(w-18,self.maxh)
for x in self.DropList.itemList:
x.SetSize(w-18,12)
self.ScrollBar.SetPosition(w-18,0)
class Edit2(ui.EditLine):
def __init__(self,main = "",ml = 99):
ui.EditLine.__init__(self)
self.SetText(main)
self.main = main
self.SetMax(ml)
self.SetUserMax(ml)
def GetText(self):
res = ui.EditLine.GetText(self)
if res == "":
return "0"
else:
return res
def __del__(self):
ui.EditLine.__del__(self)
def OnSetFocus(self):
ui.EditLine.OnSetFocus(self)
if ui.EditLine.GetText(self) == self.main:
self.SetText("")
def OnKillFocus(self):
ui.EditLine.OnKillFocus(self)
if ui.EditLine.GetText(self) == "":
self.SetText(self.main)
Switchbot Problem 11/16/2017 - Metin2 Private Server - 13 Replies Heyho liebe Com,
da ich noch relativ neu in der Metin2-Szene bin, wollte ich euch nun um Hilfe bitten, da ich mit einem Switchbot nicht mehr weiter komme.
Es sieht wie folgt aus:
Der Switchbot, der Ingame eingefügt ist kann per F6 gestartet werden. Dann öffnet er sich ganz normal und ich kann mein Item rein ziehen. Unten ist dabei ein Kasten, der für Vorschläge ist. Dort sind 3 Sachen eingespeichert --> PvP Mento usw.
Gehe ich nun in die Datei und will die Bonis anpassen und mehrere...
Problem mit Switchbot 11/21/2014 - Metin2 Private Server - 10 Replies Ich habe ein Problem mit dem Switchbot von Mijago
Thema: http://www.elitepvpers.com/forum/metin2-pserver-gu ides-strategies/3426661-r-switchbot-collection.htm l
Infos im Anhang.
https://www.virustotal.com/en/file/51a547b2631e79 be31215cb750606a947565c89596587ba055c0356bb7766854 /analysis/1416427936/
switchbot Problem von unu 10/28/2012 - Metin2 Private Server - 0 Replies Hey ich hab das problem http://www10.pic-upload.de/28.10.12/bj81c88r8u9k.j pg
Hoff mi rkann jemand helfen ..
hab win 7 habe alles als admin ausgeführt..
Switchbot Problem. 07/31/2012 - Metin2 Private Server - 0 Replies Hallo Freunde.
Da die Speicherfunktion beim neuen Padmak ja nicht funktioniert, wollte ich den Bot von Unpublished benutzen.
Leider bekomme ich immer nach ca. 5 Minuten einen Kick.
Was kann ich dagegen machen ?
Problem with switchbot 06/18/2012 - Metin2 Private Server - 0 Replies Hy epvp i have a problem with switchbot....
Screen: http://i.imgur.com/hmbo5.png
Where is the problem?
Switchbot by Unpublished