Befehl wiederholen [ANFÄNGER]

Wenn du dir nicht sicher bist, in welchem der anderen Foren du die Frage stellen sollst, dann bist du hier im Forum für allgemeine Fragen sicher richtig.
Antworten
Daxon
User
Beiträge: 2
Registriert: Samstag 21. September 2013, 23:19

Hey Leute :D
Ne kleinigkeit, und zwar benutze ich für ein Spiel einen in Python geschriebenen Hack/Bot.
Ich habe aber das Problem, dass die "DropCrap" Funktion sich nicht automatisch wiederholt, was ich allerding sehr begrüßen würde!
Hoffe ihr könnt mir helfen, bzw. sagen wie ich einstellen kann das die "DropCrap" Funktion sich alle 10 Sekunden wiederholt!!!
Hier das Script:

Code: Alles auswählen

import ui
import player
import chat
import wndMgr
import shop
import net
import app
import chr
import locale
import time
import interfacemodule
import background
import os
import skill
import chrmgr
import item
import serverInfo
import chr
import nonplayer
import snd
import math
import miniMap
import uiminimap
import exception
import uiCommon
import grp
import game
import thread
import event

IsOnScreen = "0"
buffbotstatus = ""
timing = "0"
cooltimedelay = "0"
delayslide = 0
buff1 = "0"
buff2 = "0"
buff3 = "0"
pothp = "0"
potsp = "0"

class Botdialog(ui.ThinBoard):

	def __init__(self):
		ui.ThinBoard.__init__(self)
		self.LoadBoard()
		self.skillname()
		
	def LoadBoard(self):
		self.SetCenterPosition()
		self.SetSize(340, 130)
		self.Show()
		self.AddFlag("movable")
		self.LoadText()
		self.LoadButton()
		
	def LoadText(self):
		self.Title = ui.TextLine()
		self.Title.SetParent(self)
		self.Title.SetDefaultFontName()
		self.Title.SetPosition(-90, 4)
		self.Title.SetFeather()
		self.Title.SetWindowHorizontalAlignCenter()
		self.Title.SetText("Buffbot")
		self.Title.SetFontColor(1.0, 0.5, 1.0)
		self.Title.SetOutline()
		self.Title.Show()
		
		self.TargetName = ui.TextLine()
		self.TargetName.SetParent(self)
		self.TargetName.SetDefaultFontName()
		self.TargetName.SetPosition(-70, 33)
		self.TargetName.SetFeather()
		self.TargetName.SetWindowHorizontalAlignCenter()
		self.TargetName.SetText("None")
		self.TargetName.SetOutline()
		self.TargetName.Show()

		self.Info = ui.TextLine()
		self.Info.SetParent(self)
		self.Info.SetDefaultFontName()
		self.Info.SetPosition(-125, 33)
		self.Info.SetFeather()
		self.Info.SetWindowHorizontalAlignCenter()
		self.Info.SetText("Player: ")
		self.Info.SetOutline()
		self.Info.Show()

		self.Info2 = ui.TextLine()
		self.Info2.SetParent(self)
		self.Info2.SetDefaultFontName()
		self.Info2.SetPosition(-125, 55)
		self.Info2.SetFeather()
		self.Info2.SetWindowHorizontalAlignCenter()
		self.Info2.SetText("ID:")
		self.Info2.SetOutline()
		self.Info2.Show()	

		self.ChatEditLine = ui.TextLine()
		self.ChatEditLine.SetParent(self)
		self.ChatEditLine.SetDefaultFontName()
		self.ChatEditLine.SetPosition(100, 55)
		self.ChatEditLine.SetFeather()
		self.ChatEditLine.SetText("0")
		self.ChatEditLine.SetOutline()
		self.ChatEditLine.Show()
		
		self.delayper = ui.TextLine()
		self.delayper.SetParent(self)
		self.delayper.SetPosition(20, 75)
		self.delayper.SetText("Delay-0sec")
		self.delayper.Show()	
		
	def LoadButton(self):
		self.CloseButton = ui.Button()
		self.CloseButton.SetParent(self)
		self.CloseButton.SetPosition(320, 4)
		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.SetToolTipText(locale.UI_CLOSE, 0, - 23)
		self.CloseButton.SetEvent(ui.__mem_func__(self.Close))
		self.CloseButton.Show()
		
		self.BuffBotStartButton = ui.Button()
		self.BuffBotStartButton.SetParent(self)
		self.BuffBotStartButton.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
		self.BuffBotStartButton.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
		self.BuffBotStartButton.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
		self.BuffBotStartButton.SetText("Start")
		self.BuffBotStartButton.SetPosition(200, 95)
		self.BuffBotStartButton.SetEvent(ui.__mem_func__(self.StartBuffbot))
		self.BuffBotStartButton.Show()	

		self.GetVIDButton = ui.Button()
		self.GetVIDButton.SetParent(self)
		self.GetVIDButton.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
		self.GetVIDButton.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
		self.GetVIDButton.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
		self.GetVIDButton.SetText("Get ID")
		self.GetVIDButton.SetPosition(245, 30)
		self.GetVIDButton.SetEvent(ui.__mem_func__(self.GetVID))
		self.GetVIDButton.Show()	

		self.buf1 = ui.Button()
		self.buf1.SetParent(self)
		self.buf1.SetUpVisual("d:/ymir work/ui/public/small_button_01.sub")
		self.buf1.SetOverVisual("d:/ymir work/ui/public/small_button_02.sub")
		self.buf1.SetDownVisual("d:/ymir work/ui/public/small_button_03.sub")
		self.buf1.SetText("Segen Off")
		self.buf1.SetPosition(10, 95)
		self.buf1.SetEvent(ui.__mem_func__(self.stat1))
		self.buf1.Show()

		self.buf2 = ui.Button()
		self.buf2.SetParent(self)
		self.buf2.SetUpVisual("d:/ymir work/ui/public/small_button_01.sub")
		self.buf2.SetOverVisual("d:/ymir work/ui/public/small_button_02.sub")
		self.buf2.SetDownVisual("d:/ymir work/ui/public/small_button_03.sub")
		self.buf2.SetText("Refl. Off")
		self.buf2.SetPosition(60, 95)
		self.buf2.SetEvent(ui.__mem_func__(self.stat2))
		self.buf2.Show()

		self.buf3 = ui.Button()
		self.buf3.SetParent(self)
		self.buf3.SetUpVisual("d:/ymir work/ui/public/small_button_01.sub")
		self.buf3.SetOverVisual("d:/ymir work/ui/public/small_button_02.sub")
		self.buf3.SetDownVisual("d:/ymir work/ui/public/small_button_03.sub")
		self.buf3.SetText("HDD Off")
		self.buf3.SetPosition(110, 95)
		self.buf3.SetEvent(ui.__mem_func__(self.stat3))
		self.buf3.Show()
		
		self.slidebar3 = ui.SliderBar()
		self.slidebar3.SetParent(self)
		self.slidebar3.SetPosition(100, 75)
		self.slidebar3.SetEvent(ui.__mem_func__(self .slidedelay))
		self.slidebar3.Show()
	
	def skillname(self):
		##0razb
		##2sura
		##3saman
		##5ninja
		te1=int(net.GetMainActorRace())
		te2=int(net.GetMainActorSkillGroup())
		SkillIndex=1
		if te1==3:
			SkillIndex = 91
			if te2==2:
				SkillIndex==106
		elif te1==2:
			SkillIndex = 61
			if te2==2:
				SkillIndex==76
		elif te1==5:
			SkillIndex = 31
			if te2==2:
				SkillIndex==46
		elif te1==0:
			SkillIndex = 1
			if te2==2:
				SkillIndex==16
		ski1=skill.GetSkillName(SkillIndex + 3)
		ski2=skill.GetSkillName(SkillIndex + 4)
		ski3=skill.GetSkillName(SkillIndex + 5)
		self.buf1.SetToolTipText(ski1, 0, 32)
		self.buf2.SetToolTipText(ski2, 0, 32)
		self.buf3.SetToolTipText(ski3, 0, 32)
		
	def __del__(self):
		ui.ThinBoard.__del__(self)

	def Show(self):
		ui.ThinBoard.Show(self)

	def Close(self):
		player.ClearTarget()
		global buffbotstatus, timing, cooltimedelay, delayslide, buff1, buff2, buff3, IsOnScreen
		buffbotstatus = ""
		IsOnScreen = "0"
		timing = "0"
		cooltimedelay = "0"
		delayslide = 0
		buff1 = "0"
		buff2 = "0"
		buff3 = "0"
		self.Hide()

	def OnPressEscapeKey(self):
		self.Close()
		return TRUE
		
	def slidedelay(self):
		global delayslide
		delayslide=int(self.slidebar3.GetSliderPos()*100)
		self.delayper.SetText('Delay-' + str(delayslide) + 'sec')

	def StartBuffbot(self):
		global buffbotstatus,buff1,buff2,buff3,cooltimedelay
		vid = int(self.ChatEditLine.GetText())
		if buff1=="1" or buff2=="1" or buff3=="1":
			if vid != 0:
				if buffbotstatus != "":
					buffbotstatus = ""
					self.BuffBotStartButton.SetText("Start")
				else:
					buffbotstatus = "1"
					cooltimedelay="-1"
					self.BuffBotStartButton.SetText("Stop")
					name = chr.GetNameByVID(vid)
					self.TargetName.SetText(name)
			else:
				chat.AppendChat(chat.CHAT_TYPE_INFO, "Buffbot - Get an ID first!")
		else:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Buffbot - Turn on an buff!")
		
	def GetVID(self):
		global buffbotstatus
		if buffbotstatus=="":
			if self.TargetName.GetText() != "None":
				vid = player.GetTargetVID()
				self.ChatEditLine.SetText(str(vid))
			else:
				chat.AppendChat(chat.CHAT_TYPE_INFO, "Buffbot - Select a target first!")
		else:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Buffbot - Stop bot first!")
	
	def stat1(self):
		global buff1,buffbotstatus
		if buffbotstatus=="":
			if buff1 != "1":
				self.buf1.SetText("Segen On")
				buff1 = "1"
			else:
				self.buf1.SetText("Segen Off")
				buff1 = "0"
		else:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Buffbot - Stop bot first!")

	def stat2(self):
		global buff2,buffbotstatus
		if buffbotstatus == "":
			if buff2 != "1":
				self.buf2.SetText("Refl. On")
				buff2 = "1"
			else:
				self.buf2.SetText("Refl. Off")
				buff2 = "0"
		else:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Buffbot - Stop bot first!")


	def stat3(self):
		global buff3,buffbotstatus
		if buffbotstatus=="":
			if buff3 != "1":
				self.buf3.SetText("HDD On")
				buff3 = "1"
			else:
				self.buf3.SetText("HDD Off")
				buff3 = "0"
		else:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Buffbot - Stop bot first!")

	def OnUpdate(self):
		targetVID = self.ChatEditLine.GetText()
		global buffbotstatus, buff1, buff2, buff3, cooltimedelay, delayslide
		if buffbotstatus != "" :
			self.AutoPot()
			player.SetTarget(int(targetVID))
			if cooltimedelay=="0":
				cooltimedelay = time.clock()
			else:
				curtiming = time.clock()
				if cooltimedelay=="-1":
					timetowait=0
				else:
					timetowait=cooltimedelay + delayslide
				if timetowait<curtiming:
					if buff1=="1":
						statskill= player.IsSkillCoolTime(4)
						if statskill==0:
							player.ClickSkillSlot(4)
						else:
							sk1=1
					if buff2=="1":
						statskill= player.IsSkillCoolTime(5)
						if statskill==0:
							player.ClickSkillSlot(5)
						else:
							sk2=1
					if buff3=="1":
						statskill= player.IsSkillCoolTime(6)
						if statskill==0:
							player.ClickSkillSlot(6)
						else:
							sk3=1
					if buff1=="0":
						sk1=1
					if buff2=="0":
						sk2=1
					if buff3=="0":
						sk3=1
					if sk1==1 and sk2==1 and sk3==1:
						cooltimedelay="0"
						sk1=0
						sk2=0
						sk3=0
		else:
			vid = player.GetTargetVID()
			name = chr.GetNameByVID(vid)
			self.TargetName.SetText(name)
			return

class Fundialog(ui.ThinBoard):

	SateCombo = "off"
	StateZoomHack = "off"
	StateNoFog = "off"
	StateDayNight = "off"

	def __init__(self):
		ui.ThinBoard.__init__(self)
		self.LoadBoard()
		self.skillname()
		
	def LoadBoard(self):
		self.SetCenterPosition()
		self.SetSize(110, 150)
		self.Show()
		self.AddFlag("movable")

		self.CloseButton = ui.Button()
		self.CloseButton.SetParent(self)
		self.CloseButton.SetPosition(90, 4)
		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.SetToolTipText(locale.UI_CLOSE, 0, -20)
		self.CloseButton.SetEvent(ui.__mem_func__(self.Close))
		self.CloseButton.Show()
				
		self.MainLabel = ui.TextLine()
		self.MainLabel.SetParent(self)
		self.MainLabel.SetDefaultFontName()
		self.MainLabel.SetPosition(-20, 10)
		self.MainLabel.SetFeather()
		self.MainLabel.SetWindowHorizontalAlignCenter()
		self.MainLabel.SetText("Fun Zeugs")
		self.MainLabel.SetFontColor(1.0, 0.5, 1.0)
		self.MainLabel.SetOutline()
		self.MainLabel.Show()
		
		self.ComboButton = ui.Button()
		self.ComboButton.SetParent(self)
		self.ComboButton.SetPosition(10, 30)
		self.ComboButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.ComboButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.ComboButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.ComboButton.SetText("ComboHack Off")
		self.ComboButton.SetEvent(self.Combo)
		self.ComboButton.Show()
		
		self.ZoomHackButton = ui.Button()
		self.ZoomHackButton.SetParent(self)
		self.ZoomHackButton.SetPosition(10, 60)
		self.ZoomHackButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.ZoomHackButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.ZoomHackButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.ZoomHackButton.SetText("ZoomHack Off")
		self.ZoomHackButton.SetEvent(self.ZoomHack)
		self.ZoomHackButton.Show()
		
		self.NoFogButton = ui.Button()
		self.NoFogButton.SetParent(self)
		self.NoFogButton.SetPosition(10, 90)
		self.NoFogButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.NoFogButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.NoFogButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.NoFogButton.SetText("NoFog Off")
		self.NoFogButton.SetEvent(self.NoFog)
		self.NoFogButton.Show()

		self.DayNightButton = ui.Button()
		self.DayNightButton.SetParent(self)
		self.DayNightButton.SetPosition(10, 120)
		self.DayNightButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.DayNightButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.DayNightButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.DayNightButton.SetText("Day")
		self.DayNightButton.SetEvent(ui.__mem_func__(self.DayNight))
		self.DayNightButton.Show()

	def Combo(self):
		global SateCombo 
		if self.SateCombo == "off":
			self.SateCombo = "on"
			self.ComboButton.SetText("ComboHack On")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "ComboHack aktiviert")
			chr.testSetComboType(2)
		else:
			self.SateCombo = "off"
			self.ComboButton.SetText("ComboHack Off")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "ComboHack deaktiviert")
			chr.testSetComboType(0)

	def ZoomHack(self):
		global StateZoomHack
		if self.StateZoomHack == "off":
			self.StateZoomHack = "On"
			self.ZoomHackButton.SetText("ZoomHack On")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "ZoomHack aktiviert")
			app.SetCameraMaxDistance(12000)	
		else:	
			self.StateZoomHack = "off"
			self.ZoomHackButton.SetText("ZoomHack Off")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "ZoomHack deaktiviert")
			app.SetCameraMaxDistance(2500)	
	
	def NoFog(self):
		global StateNoFog
		if self.StateNoFog == "off":
			self.StateNoFog = "on"
			self.NoFogButton.SetText("NoFog On")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "NoFog aktiviert")
			app.SetMinFog(70000)
		else:	
			self.StateNoFog = "off"
			self.NoFogButton.SetText("NoFog Off")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "NoFog deaktiviert")
			app.SetMinFog(2500)

	def DayNight(self):
		global StateDayNight
		if self.StateDayNight == "off":
			self.StateDayNight = "on"
			self.DayNightButton.SetText("Night")
			background.SetEnvironmentData(1)
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Set Night")
			background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
		else:	
			self.StateDayNight = "off"
			self.DayNightButton.SetText("Day")
			background.SetEnvironmentData(0)
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Set Day")

	def __del__(self):
		ui.ThinBoard.__del__(self)

	def Show(self):
		ui.ThinBoard.Show(self)

	def Close(self):
		self.Hide()

	def OnPressEscapeKey(self):
		self.Close()
		return TRUE	

class bot(ui.ScriptWindow):
	StatePickup = "off"
	StateRestart = "off"
	SateAutoAttack = "off"
	StatePuller = "off"
	StateSpenden = "off"
	StateTau = "off"
	StateBuff = "off"
	StateDead = "on"
	deaktAttack = "off"
	StateSelfBuff = "off"
	StateDropCrap = "on"
		
	def __init__(self):
		ui.ScriptWindow.__init__(self)
		self.PickupButton = ui.Button()
		self.PickupButton.SetPosition(wndMgr.GetScreenWidth() - 100, wndMgr.GetScreenHeight() / 4 + 30)
		self.PickupButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.PickupButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.PickupButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.PickupButton.SetText("Pickup Off")
		self.PickupButton.SetEvent(self.SetPickup)
		self.PickupButton.Show()
		
		self.CloseButton = ui.Button()
		self.CloseButton.SetPosition(wndMgr.GetScreenWidth() - 100, wndMgr.GetScreenHeight() / 4 + 0)
		self.CloseButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.CloseButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.CloseButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.CloseButton.SetText("Hide All")
		self.CloseButton.SetEvent(self.__del__)
		self.CloseButton.Show()
		
		self.RestartButton = ui.Button()
		self.RestartButton.SetPosition(wndMgr.GetScreenWidth() - 100, wndMgr.GetScreenHeight() / 4 + 60)
		self.RestartButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.RestartButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.RestartButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.RestartButton.SetText("AutoRestart Off")
		self.RestartButton.SetEvent(self.SetRestart)
		self.RestartButton.Show()

		self.GhostModButton = ui.Button()
		self.GhostModButton.SetPosition(wndMgr.GetScreenWidth() - 100, wndMgr.GetScreenHeight() / 4 + 90)
		self.GhostModButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.GhostModButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.GhostModButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.GhostModButton.SetText("GhostMod")
		self.GhostModButton.SetEvent(self.GhostMod)
		self.GhostModButton.Show()		
		
		self.BuffButton = ui.Button()
		self.BuffButton.SetPosition(wndMgr.GetScreenWidth() - 100, wndMgr.GetScreenHeight() / 4 + 120)
		self.BuffButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.BuffButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.BuffButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.BuffButton.SetText("BuffBot")
		self.BuffButton.SetEvent(self.ShowBuff)
		self.BuffButton.Show()
		
		self.FunButton = ui.Button()
		self.FunButton.SetPosition(wndMgr.GetScreenWidth() - 100, wndMgr.GetScreenHeight() / 4 + 150)
		self.FunButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.FunButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.FunButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.FunButton.SetText("Fun Zeugs")
		self.FunButton.SetEvent(self.ShowFun)
		self.FunButton.Show()
		
		self.iCloseButton = ui.Button()
		self.iCloseButton.SetPosition(wndMgr.GetScreenWidth() - 100, wndMgr.GetScreenHeight() / 4 + 180)
		self.iCloseButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.iCloseButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.iCloseButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.iCloseButton.SetText("Close Window")
		self.iCloseButton.SetEvent(self.InstantClose)
		self.iCloseButton.Show()	
		
		# Levelbot Ui
		self.AutoAttackButton = ui.Button()
		self.AutoAttackButton.SetPosition(wndMgr.GetScreenWidth() - 200, wndMgr.GetScreenHeight() / 4 + 0)
		self.AutoAttackButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.AutoAttackButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.AutoAttackButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.AutoAttackButton.SetText("AutoAttack Off")
		self.AutoAttackButton.SetEvent(self.AutoAttack)
		self.AutoAttackButton.Show()		
		
		self.SetPullerButton = ui.Button()
		self.SetPullerButton.SetPosition(wndMgr.GetScreenWidth() - 200, wndMgr.GetScreenHeight() / 4 + 30)
		self.SetPullerButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.SetPullerButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.SetPullerButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.SetPullerButton.SetText("MobPuller Off")
		self.SetPullerButton.SetEvent(self.SetPuller)
		self.SetPullerButton.Show()
		
		self.SpendenButton = ui.Button()
		self.SpendenButton.SetPosition(wndMgr.GetScreenWidth() - 200, wndMgr.GetScreenHeight() / 4 + 60)
		self.SpendenButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.SpendenButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.SpendenButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.SpendenButton.SetText("AutoSpenden Off")
		self.SpendenButton.SetEvent(self.SetSpenden)
		self.SpendenButton.Show()
		
		self.TauButton = ui.Button()
		self.TauButton.SetPosition(wndMgr.GetScreenWidth() - 200, wndMgr.GetScreenHeight() / 4 + 90)
		self.TauButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.TauButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.TauButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.TauButton.SetText("AutoTau Off")
		self.TauButton.SetEvent(self.SetTau)
		self.TauButton.Show()
		
		self.SkillButton = ui.Button()
		self.SkillButton.SetPosition(wndMgr.GetScreenWidth() - 200, wndMgr.GetScreenHeight() / 4 + 120)
		self.SkillButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.SkillButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.SkillButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.SkillButton.SetText("SelfBuff Off")
		self.SkillButton.SetEvent(self.SetSelfBuff)
		self.SkillButton.Show()
		
		self.DropCrapButton = ui.Button()
		self.DropCrapButton.SetPosition(wndMgr.GetScreenWidth() - 200, wndMgr.GetScreenHeight() / 4 + 150)
		self.DropCrapButton.SetUpVisual("d:/ymir work/ui/public/large_Button_01.sub")
		self.DropCrapButton.SetOverVisual("d:/ymir work/ui/public/large_Button_02.sub")
		self.DropCrapButton.SetDownVisual("d:/ymir work/ui/public/large_Button_03.sub")
		self.DropCrapButton.SetText("DropCrap Off")
		self.DropCrapButton.SetEvent(self.SetDropCrap)
		self.DropCrapButton.Show()	
		###############################
		self.MainLabel = ui.TextLine()
		self.MainLabel.SetParent(self)
		self.MainLabel.SetDefaultFontName()
		self.MainLabel.SetPosition(wndMgr.GetScreenWidth() - 250, 10)
		self.MainLabel.SetFeather()
		self.MainLabel.SetWindowHorizontalAlignCenter()
		self.MainLabel.SetText("FARM- & MULTIBOT by AN0N")
		self.MainLabel.SetFontColor(1.0, 0.5, 1.0)
		self.MainLabel.SetOutline()
		self.MainLabel.Show()

	def __del__(self):
		ui.ScriptWindow.__del__(self)
		self.SkillButton.Hide()
		self.SetPullerButton.Hide()
		self.GhostModButton.Hide()
		self.AutoAttackButton.Hide()
		self.DropCrapButton.Hide()
		self.PickupButton.Hide()
		self.CloseButton.Hide()
		self.RestartButton.Hide()
		self.MainLabel.Hide()
		self.SpendenButton.Hide()
		self.TauButton.Hide()
		self.FunButton.Hide()
		self.BuffButton.Hide()
		self.iCloseButton.Hide()
		self.StatePickup = "off"
		self.StateRestart = "off"
		self.SateAutoAttack = "off"
		self.StatePuller = "off"
		self.StateSpenden = "off"
		self.StateTau = "off"
		self.StateBuff = "off"
		self.StateSelfBuff = "off"
		self.StateDropCrap = "off"
		chat.AppendChat(chat.CHAT_TYPE_INFO, "Bot deaktiviert!")

	#net.SendWhisperPacket("kussi", "ey homoe, dein char hat 1,5kkk")

	def ShowBuff(self):
		global IsOnScreen
		if IsOnScreen=="0":
			self.dialstarter=Botdialog()
			self.dialstarter.Show()
			IsOnScreen="1"
		else:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Buffbot ist bereits gestartet")
		
	def ShowFun(self):
		self.dialstarter=Fundialog()
		self.dialstarter.Show()
		
	def InstantClose(self):
		app.Exit()

	def SetDropCrap(self):
		if str(self.StateDropCrap) == "off":
			self.StateDropCrap = "on"
			self.DropCrapButton.SetText("DropCrap On")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "DropCrap aktiviert")
			self.DropCrap()
		else:
			self.StateDropCrap = "off"
			self.DropCrapButton.SetText("DropCrap Off")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "DropCrap deaktiviert")
			
	def DropCrap(self):
		global StateDropCrap
		if str(self.StateDropCrap) == "on":
			for i in xrange(0, 90):
				ItemValue = player.GetItemIndex(i)
				if ItemValue == 50033:
					net.SendItemUsePacket(i)
			#VWK 70104
			CrapItems = [12246,11276,11476,11676,11876,17109,12386,12526,12666,14066,17206,11286,11296,11486,11496,11686,11696,11886,11896,146,156,166,186,246,1106,1116,1136,2136,2146,2176,3136,3146,3166,5006,5066,5106,5126,7086,7096,7136,7146,7166,17186,17146,17166,17126,17106,17086,17066,16206,16186,16166,16146,16126,16106,14086,16086,16066,15226,15166,15206,15186,14106,15146,15126,15106,15066,15086,14126,14206,14186,14166,14146,7051,1040,30028,30032,7070,30052,8001,28139,28136,30041,28231,28330,30031,28138,28243,28232,28132,28143,28142,28234,28131,50300,28140,13040,13041,13042,13043,13044,13045,13046,50728,30301,17164,5084,30067,15164,70106,17144,17104,16084,70105,30089,13205,12664,13080,13120,16064,13006,50727,50723,50321,12240,27001,12500,12501,12502,12503,12504,12505,12506,12360,12361,12362,12363,12364,12365,12366,12220,12221,12222,12223,12224,12225,12226,12640,12641,12642,12643,12644,12645,12646,12480,12481.12482,12483,12484,12485,12486,12340,12341,12342,12343,12344,12345,12346,12201,12200,12202,12203,12204,12205,12206,12620,12621,12622,12623,12624,12625,12626,16044,5064,5074,12240,27004,50722,70104,27002,12380,17160,25100,17181,14202,14203,14204,14201,17201,17200,17202,17203,17204,12645,12520,1090,50054,1092,16160,15222,15160,27005,14160,5070,16200,13194,13190,13191,13192,13193,50055,2120,2121,2122,2123,2124,2100,2101,2102,2103,2104,5080,110,111,112,113,114,15200,15201,15202,15203,15204,27990,50313,1091,16181,15180,104,13060
,15161,13100,16161,2102,1080,50320,50306,5062,16180,3090
,3091,3092,3093,3094,16180,16201,14161,17184,16124,16123,16122,16121,16120,1060,1061,1062,1063,1064,1071,1070,1072,1073,1074,2101,5082,12660,15162,1081,50061,3129,70102,27006,17161,15221,27003,14181,50726,5081,17180,50304,15182,15183,50056,17202,50314,5060,16202,50301,50312,50721,100,101,102,3120,3121,3122,30055,17182,5072,14162,5061,1082,50007,1072,50724,50315,50302,5081,30022,50725,16104,50600,17162,14201,130,131,132,133,134,15181,50303,50311,2090,2091,2092,2093,2094,5071,14200,15220,50305,14182,120,121,122,123,124,3110,3111,3112,3113,3114,3100,3101,3102,3103,3104,50316,2110,2111,2112,2113,2114,50006,14180,14181,14182,14183,14184,16182,16162,12244,12384]
			for i in xrange(0, 90):
				ItemValue = player.GetItemIndex(i)
				if ItemValue in CrapItems:
					net.SendItemDropPacket(i)
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Crap gedroppt")
			chat.AppendChat(chat.CHAT_TYPE_INFO, counter)
			global StatePickup
			if self.StatePickup == "on":
				self.SetPickup()
				self.delayCrap = WaitingDialog()
				self.delayCrap.Open(6)
				self.delayCrap.SAFE_SetTimeOverEvent(self.SetPickup)
			self.delayCrap2 = WaitingDialog()
			self.delayCrap2.Open(10)
			self.delayCrap2.SAFE_SetTimeOverEvent(self.DropCrap)
		
	def StartAttack(self):
		self.SateAutoAttack = "on"
		self.AutoAttackButton.SetText("AutoAttack On")
		self.EnableAutoAttack()
		chat.AppendChat(chat.CHAT_TYPE_INFO, "AutoAttack aktiviert")		
		
	def StopAttack(self):
		self.SateAutoAttack = "off"
		self.AutoAttackButton.SetText("AutoAttack Off")
		chat.AppendChat(chat.CHAT_TYPE_INFO, "AutoAttack deaktiviert")	
		
	def selfBuff(self):
		if player.IsMountingHorse():
			net.SendChatPacket("/unmount")
		self.delayBuff = WaitingDialog()
		self.delayBuff.Open(1)
		self.delayBuff.SAFE_SetTimeOverEvent(self.BuffMe)
		self.delayBuff2 = WaitingDialog()
		self.delayBuff2.Open(3)
		self.delayBuff2.SAFE_SetTimeOverEvent(self.horse)
		
	def BuffMe(self):
		player.ClickSkillSlot(4)
	
	def horse(self):
		mountis = 0
		for i in xrange(player.INVENTORY_PAGE_SIZE*2):
				ItemValue = player.GetItemIndex(i)
				if ItemValue == 52045 or ItemValue == 52005:
					net.SendItemUsePacket(i)
					               
	def SetPickup(self):
		global StatePickup
		if str(self.StatePickup) == "off":
			self.StatePickup = "on"		
			self.PickupButton.SetText("Pickup On")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "PickUp aktiviert")
			self.EnablePickup()
		else:
			self.StatePickup = "off"
			self.PickupButton.SetText("Pickup Off")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "PickUp deaktiviert")

	def EnablePickup(self):
		global StatePickup
		if str(self.StatePickup) == "on":
			player.PickCloseItem();		
		self.delayPick = WaitingDialog()
		self.delayPick.Open(1.5)
		self.delayPick.SAFE_SetTimeOverEvent(self.EnablePickup)
			
	def SetRestart(self):
		if str(self.StateRestart) == "off":
			self.StateRestart = "on"		
			self.RestartButton.SetText("AutoRestart On")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "AutoRestart aktiviert")
			self.EnableRestart()
		else:
			self.StateRestart = "off"
			self.RestartButton.SetText("AutoRestart Off")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "AutoRestart deaktiviert")
	
	def drachenmedaille(self):
		for i in xrange(player.INVENTORY_PAGE_SIZE*2):
			ItemValue = player.GetItemIndex(i)
			if ItemValue == 71004:
				net.SendItemUsePacket(i)
	
	def EnableRestart(self):
		self.delayRestart = WaitingDialog()
		self.delayRestart.Open(int(2.5))
		global StateRestart
		if player.GetStatus(player.HP) <= 0 and str(self.StateRestart) == "on":
			net.SendChatPacket("/restart_here")
			global SateAutoAttack
			if self.SateAutoAttack == "on":
				player.SetAttackKeyState(FALSE)
				self.StopAttack()
				chat.AppendChat(chat.CHAT_TYPE_INFO, "AutoAttack fuer 25 Sekunden deaktiviert!")
				self.delayRestart2 = WaitingDialog()
				self.delayRestart2.Open(25)
				self.delayRestart2.SAFE_SetTimeOverEvent(self.StartAttack)
			global StatePuller
			if self.StatePuller == "on":
				self.SetPuller()
				chat.AppendChat(chat.CHAT_TYPE_INFO, "MobPuller fuer 30 Sekunden deaktiviert!")				
				self.delayRestart3 = WaitingDialog()
				self.delayRestart3.Open(30)
				self.delayRestart3.SAFE_SetTimeOverEvent(self.SetPuller)
			self.delayRestart9 = WaitingDialog()
			self.delayRestart9.Open(1)
			self.delayRestart9.SAFE_SetTimeOverEvent(self.drachenmedaille)
		self.delayRestart.SAFE_SetTimeOverEvent(self.EnableRestart)
		
	def SetPuller(self):
		if str(self.StatePuller) == "off":
			self.StatePuller = "on"		
			self.SetPullerButton.SetText("MobPuller On")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "MobPuller aktiviert")
			self.EnablePuller()
		else:
			self.StatePuller = "off"
			self.SetPullerButton.SetText("MobPuller Off")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "MobPuller deaktiviert")
	
	def EnablePuller(self):
		self.delayPuller = WaitingDialog()
		self.delayPuller.Open(int(7.0))
		global StatePuller
		if str(self.StatePuller) == "on":
			for i in xrange(player.INVENTORY_PAGE_SIZE*2):
				ItemValue = player.GetItemIndex(i)
				if ItemValue == 70038:
					net.SendItemUsePacket(i)
					break
		self.delayPuller.SAFE_SetTimeOverEvent(self.EnablePuller)
		
	def SetTau(self):
		if str(self.StateTau) == "off":
			self.StateTau = "on"		
			self.TauButton.SetText("AutoTau On")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "AutoTau aktiviert")
			self.EnableTau()
		else:
			self.StateTau = "off"
			self.TauButton.SetText("AutoTau Off")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "AutoTau deaktiviert")
	
	def EnableTau(self):
		self.delayTau = WaitingDialog()
		self.delayTau.Open(int(20.0))
		global StateTau
		if str(self.StateTau) == "on":
			for i in xrange(player.INVENTORY_PAGE_SIZE*2):
				ItemValue = player.GetItemIndex(i)
				if ItemValue == 71034 or ItemValue == 50824 or ItemValue == 50826 or ItemValue == 50823 or ItemValue == 50825 or ItemValue == 50822 or ItemValue == 50821:
					net.SendItemUsePacket(i)
		self.delayTau.SAFE_SetTimeOverEvent(self.EnableTau)
		
	def SetSpenden(self):
		global StateSpenden
		if str(self.StateSpenden) == "off":
			self.StateSpenden = "on"		
			self.SpendenButton.SetText("AutoSpenden On")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "AutoSpenden aktiviert")
			self.EnableSpenden()
		else:
			self.StateSpenden = "off"
			self.SpendenButton.SetText("AutoSpenden Off")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "AutoSpenden deaktiviert")
	
	def EnableSpenden(self):
		self.delaySpenden = WaitingDialog()
		self.delaySpenden.Open(int(10.0))
		global StateSpenden
		if str(self.StateSpenden) == "on":
			Exp = player.GetEXP()
			if Exp >= 100:
				net.SendGuildOfferPacket(Exp)
		self.delaySpenden.SAFE_SetTimeOverEvent(self.EnableSpenden)	
	
	def GhostMod(self):
		if player.GetStatus(player.HP) <= 0:
			chr.Revive()
			chat.AppendChat(chat.CHAT_TYPE_INFO, "GhostMod aktiviert")
		else:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Geht nur wenn du tot bist")
		
	def AutoAttack(self):
		global SateAutoAttack
		if self.SateAutoAttack == "off":
			self.AutoAttackButton.SetText("AutoAttack On")
			self.SateAutoAttack = "on"
			self.EnableAutoAttack()
			chat.AppendChat(chat.CHAT_TYPE_INFO, "AutoAttack aktiviert")
		else:	
			self.SateAutoAttack = "off"
			self.AutoAttackButton.SetText("AutoAttack Off")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "AutoAttack deaktiviert")
			
	def SetSelfBuff(self):
		global StateSelfBuff
		if self.StateSelfBuff == "off":
			self.SkillButton.SetText("SelfBuff On")
			self.StateSelfBuff = "on"
			chat.AppendChat(chat.CHAT_TYPE_INFO, "SelfBuff aktiviert")
			self.EnableSelfBuff()
		else:	
			self.StateSelfBuff = "off"
			self.SkillButton.SetText("SelfBuff Off")
			chat.AppendChat(chat.CHAT_TYPE_INFO, "SelfBuff deaktiviert")
			
	def EnableSelfBuff(self):
		if str(self.StateSelfBuff) == "on":
			statskill= player.IsSkillCoolTime(4)
			if statskill==0:
				self.selfBuff()
		self.delayEnableSelfBuff = WaitingDialog()
		self.delayEnableSelfBuff.Open(1)
		self.delayEnableSelfBuff.SAFE_SetTimeOverEvent(self.EnableSelfBuff)
		
	def EnableAutoAttack(self):
		global StateAutoAttack
		if self.SateAutoAttack == "on":
			player.SetAttackKeyState(TRUE)
			#Direction = app.GetRandom(0,7)
			#chr.SetDirection(Direction)
		else:
			player.SetAttackKeyState(FALSE)
		self.delayAttack = WaitingDialog()
		self.delayAttack.Open(0.3)
		self.delayAttack.SAFE_SetTimeOverEvent(self.EnableAutoAttack)

	def OnUpdate(self):
		# old pickup
		global StatePickup
		#if str(self.StatePickup) == "on":
		#	player.PickCloseItem();

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):
		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):
		lastTime = max(0, self.endTime - time.clock())
		if 0 == lastTime:
			self.Close()
			self.eventTimeOver()	
		else:
			return
		
	def OnPressExitKey(self):
		self.Close()
		return TRUE

StartDialog = bot()
StartDialog.Show()
-------------------------------------------------
Hoffe auf hilfreiche Antworten!!!! :D :D :D
Zuletzt geändert von Anonymous am Samstag 21. September 2013, 23:58, insgesamt 1-mal geändert.
Grund: Quelltext in Python-Code-Tags gesetzt.
BlackJack

@Daxon: Da bräuchte man Ahnung von dem Spiel und der Dokumentation der API. Es scheint in dem Skript schon etwas mit zeitgesteuerten Rückrufen gemacht zu werden, also wird das grundsätzlich wohl gehen. An dem Skript müsste man IMHO aber vorher noch einiges anderes sauberer lösen bevor man es erweitert.
Dami123
User
Beiträge: 225
Registriert: Samstag 23. Februar 2013, 13:01

Mit einer "while"-Schleife + Bedingung.
Bei dir im Code ist es:

Code: Alles auswählen

if str(self.StateDropCrap) == "on":
                        for i in xrange(0, 90):
                                ItemValue = player.GetItemIndex(i)
                                if ItemValue == 50033:
                                        net.SendItemUsePacket(i)
                        #VWK 70104
                        ...
Wenn du die "if"-Abfrage zu einer "while"-Schleife änderst, sollte sich der Vorgang solange wiederholen, bis sich der "self.StateDropCrap" ändert.
Statt 8 Leerzeichen, solltest du 4 verwenden.
Daxon
User
Beiträge: 2
Registriert: Samstag 21. September 2013, 23:19

Dami123 hat geschrieben:Mit einer "while"-Schleife + Bedingung.
Bei dir im Code ist es:

Code: Alles auswählen

if str(self.StateDropCrap) == "on":
                        for i in xrange(0, 90):
                                ItemValue = player.GetItemIndex(i)
                                if ItemValue == 50033:
                                        net.SendItemUsePacket(i)
                        #VWK 70104
                        ...
Wenn du die "if"-Abfrage zu einer "while"-Schleife änderst, sollte sich der Vorgang solange wiederholen, bis sich der "self.StateDropCrap" ändert.
Statt 8 Leerzeichen, solltest du 4 verwenden.
Hab wirklich gar keine Ahnung^^
Könntest du das vill tippen???
Wäre echt Klasse :S
Dami123
User
Beiträge: 225
Registriert: Samstag 23. Februar 2013, 13:01

Wenn das nicht dein Code ist, kann ich dir nicht sagen, welche Auswirkungen das auf das Programm haben wird.
Im Normalfall hängt sich ein GUI Programm auf, wenn eine endlose Schleife oder "time.sleep()" Pause gestartet wird.
Deswegen ist auch keine einzige im ganzen Programm enthalten :D
Antworten