Yardım butona foksiyonu aktif etme

  • Konuyu açan Konuyu açan DELIASIL
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 16
  • Gösterim Gösterim 215
Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

DELIASIL

Premium Üye
Premium Üye
Üye
Mesaj
171
Çözümler
7
Beğeni
39
Puan
89
Ticaret Puanı
0
game.py içerisinde
game.py:
Genişlet Daralt Kopyala
            onPressKeyDict[app.DIK_F8]        = lambda : self.__PressF8Key()

F8 botununa basınca ise ;


game.py:
Genişlet Daralt Kopyala
        def __PressF8Key(self):
            self.interface.ToggleIkashopSearchShopBoard()
-
Bu şekilde çalışmasında problem yok
lakin f5 butonu içerisine 1. sıraya bunu eklemek istediğimde

uispeedbutton.py:
Genişlet Daralt Kopyala
    def ButtonEvent(self,arg):
        if int(arg) == 1:
            if app.GetTime() > self.Button1_Timer:
#              net.SendChatPacket("/open_shop")
                self.Button2_Timer = app.GetTime() + 1
            else:
                Button1_TimerInfo = self.Button1_Timer - app.GetTime()
                chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.INFORMATION_TIME_CLICK % (Button1_TimerInfo))

İşaretli yere ne şekilde eklemem gerekiyor f5 butonun 1. sıradakine basınca f8 butonundaki fonksiyonu açabilmesi için
 
Sen bunumu açılsın istiyorsun F8 Basınca net.SendChatPacket("/open_shop")
F5 Tuşuna basınca hızlı menü açılıyor orada ticaret camı var 1. sırada ama çalışmıyor , normalde et.SendChatPacket("/open_shop") bu yazıyor,

F8 tuşuna basınca ticaret camı açılıyor. bunu f5 de dediğim yere tıklayınca açılmasını istiyorum
 
example.py:
Genişlet Daralt Kopyala
    def ButtonEvent(self,arg):
        if int(arg) == 1:
            if app.GetTime() > self.Button1_Timer:
                self.interface.ToggleIkashopSearchShopBoard()
                self.Button2_Timer = app.GetTime() + 1
            else:
                Button1_TimerInfo = self.Button1_Timer - app.GetTime()
                chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.INFORMATION_TIME_CLICK % (Button1_TimerInfo))
 
example.py:
Genişlet Daralt Kopyala
    def ButtonEvent(self,arg):
        if int(arg) == 1:
            if app.GetTime() > self.Button1_Timer:
                self.interface.ToggleIkashopSearchShopBoard()
                self.Button2_Timer = app.GetTime() + 1
            else:
                Button1_TimerInfo = self.Button1_Timer - app.GetTime()
                chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.INFORMATION_TIME_CLICK % (Button1_TimerInfo))
hocam bu dediğinizi ben denedim zaten ama olmamıştı siz dediniz birdaha denedim yine bu şekilde olmuyor,

syserr:
Genişlet Daralt Kopyala
1031 00:23:20460 :: AttributeError
1031 00:23:20460 :: :
1031 00:23:20460 :: 'SpeedButtonWindow' object has no attribute 'interface'
1031 00:23:20460 ::

1031 00:23:20578 :: Traceback (most recent call last):

1031 00:23:20578 ::   File "ui.py", line 1328, in CallEvent

1031 00:23:20578 ::   File "ui.py", line 166, in __call__

1031 00:23:20578 ::   File "ui.py", line 157, in __call__

1031 00:23:20578 ::   File "uispeedbutton.py", line 124, in ButtonEvent

1031 00:23:20578 :: AttributeError
1031 00:23:20578 :: :
1031 00:23:20578 :: 'SpeedButtonWindow' object has no attribute 'interface'
1031 00:23:20578 ::
 
hocam bu dediğinizi ben denedim zaten ama olmamıştı siz dediniz birdaha denedim yine bu şekilde olmuyor,

syserr:
Genişlet Daralt Kopyala
1031 00:23:20460 :: AttributeError
1031 00:23:20460 :: :
1031 00:23:20460 :: 'SpeedButtonWindow' object has no attribute 'interface'
1031 00:23:20460 ::

1031 00:23:20578 :: Traceback (most recent call last):

1031 00:23:20578 ::   File "ui.py", line 1328, in CallEvent

1031 00:23:20578 ::   File "ui.py", line 166, in __call__

1031 00:23:20578 ::   File "ui.py", line 157, in __call__

1031 00:23:20578 ::   File "uispeedbutton.py", line 124, in ButtonEvent

1031 00:23:20578 :: AttributeError
1031 00:23:20578 :: :
1031 00:23:20578 :: 'SpeedButtonWindow' object has no attribute 'interface'
1031 00:23:20578 ::
Bence import interfacemodule.py eklemelesin importlara.
 
hocam bu dediğinizi ben denedim zaten ama olmamıştı siz dediniz birdaha denedim yine bu şekilde olmuyor,

syserr:
Genişlet Daralt Kopyala
1031 00:23:20460 :: AttributeError
1031 00:23:20460 :: :
1031 00:23:20460 :: 'SpeedButtonWindow' object has no attribute 'interface'
1031 00:23:20460 ::

1031 00:23:20578 :: Traceback (most recent call last):

1031 00:23:20578 ::   File "ui.py", line 1328, in CallEvent

1031 00:23:20578 ::   File "ui.py", line 166, in __call__

1031 00:23:20578 ::   File "ui.py", line 157, in __call__

1031 00:23:20578 ::   File "uispeedbutton.py", line 124, in ButtonEvent

1031 00:23:20578 :: AttributeError
1031 00:23:20578 :: :
1031 00:23:20578 :: 'SpeedButtonWindow' object has no attribute 'interface'
1031 00:23:20578 ::
interface guiye bağlanmış olması lazım pc geçince örnek atacağım
 
büyük ihtimalle interface guiye bağlanmamış uispeedbutton.py içerisinde self.interface kontrol ettin mi?
 
uispeedbutton.py:
Genişlet Daralt Kopyala
import ui
import mouseModule
import snd
import uiScriptLocale
import uiCommon
import uiPrivateShopBuilder
import localeInfo
import constInfo
import time
import wndMgr
import interfaceModule
import dbg
import uiToolTip
import grp
import translate
import chat
import app
import net

class SpeedButtonWindow(ui.ScriptWindow):
    Button1_Timer = 0
    Button2_Timer = 0
    Button3_Timer = 0
    Button4_Timer = 0
    Button5_Timer = 0
    Button6_Timer = 0
    Button7_Timer = 0
    Button8_Timer = 0
    Button9_Timer = 0
    Button10_Timer = 0
    Button11_Timer = 0
    Button12_Timer = 0

    def __init__(self):
        ui.ScriptWindow.__init__(self)
        self.__Initialize()
        self.__Load()

    def __del__(self):
        ui.ScriptWindow.__del__(self)
        print "DELETE SpeedButtonWindow"

    def __Initialize(self):
        self.titleBar = None
        self.toolTip = uiToolTip.ToolTip()
        self.interface = interfaceModule.Interface()

    def Destroy(self):
        self.ClearDictionary()
        self.__Initialize()
        print "DESTROY SpeedButtonWindow"

    def __Load_LoadScript(self, fileName):
        try:
            pyScriptLoader = ui.PythonScriptLoader()
            pyScriptLoader.LoadScriptFile(self, fileName)
        except:
            import exception
            exception.Abort("SpeedButtonWindow.__Load_LoadScript")

    def __Load_BindObject(self):
        try:
            self.titleBar = self.GetChild("board")

            for i in xrange(1, 13):
                btn = self.GetChild("Button%d" % i)
                btn.SAFE_SetEvent(self.ButtonEvent, i)
                setattr(self, "Button%d" % i, btn)

        except:
            import exception
            exception.Abort("SpeedButtonWindow.__Load_BindObject")

    def __ShowMenuToolTip(self, statDesc):
        self.toolTip.ClearToolTip()
        self.toolTip.AppendTextLine(statDesc)
        self.toolTip.Show()

    def __OverInButtonMenu(self, num):   
        try:
            self.__ShowMenuToolTip(translate.SystemMenuText[num])
        except KeyError:
            pass

    def __OverOutButtonMenu(self):
        self.toolTip.Hide()

    def ButtonEvent(self, arg):
        arg = int(arg)
        current_time = app.GetTime()
        timer_attr = "Button%d_Timer" % arg
        last_time = getattr(self, timer_attr)

        if current_time < last_time:
            remaining = last_time - current_time
            chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.INFORMATION_TIME_CLICK % remaining)
            return

        # Timer güncelle
        setattr(self, timer_attr, current_time + 2)

        # 🔧 Buton eylemleri
        if arg == 1:
            self.interface.ToggleIkashopSearchShopBoard()

        elif arg == 2:
            self.interface.ToggleIkashopBusinessBoard()

        elif arg == 3:
            constInfo.ORTALAMA = 1

        elif arg == 4:
            constInfo.SOME_FLAG = 1

        elif arg == 5:
            net.SendChatPacket("/log_open_window 0")

        elif arg == 6:
            constInfo.CHEQUE_TO_GOLD_INFO_OPEN_2 = 1

        elif arg == 7:
            constInfo.DUNGEON_INFO_WINDOW = 1

        elif arg == 8:
            constInfo.OPEN_BOSS_TRACKING = 1

        elif arg == 9 and app.ENABLE_SWITCHBOT:
            self.interface.ToggleSwitchbotWindow()

        elif arg == 10:
            chat.AppendChat(chat.CHAT_TYPE_INFO, "Bu özellik devre dışı.")

        elif arg == 11:
            chat.AppendChat(chat.CHAT_TYPE_INFO, "Sistem bakımda.")

        elif arg == 12:
            chat.AppendChat(chat.CHAT_TYPE_INFO, "Boş buton - eylem yok.")

        self.Close()

    def __Load(self):
        self.__Load_LoadScript("uiscript/speedbutton.py")
        self.__Load_BindObject()
        self.SetCenterPosition()
        if self.titleBar:
            self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))

    def OnUpdate(self):
        pass

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

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

    def Close(self):
        self.Hide()

kopyala yapıştır yap dene syser.log vericekmi verirse syser atarmısın
 
kopyala yapıştır yap dene syser.log vericekmi verirse syser atarmısın

1031 03:50:14933 :: AttributeError
1031 03:50:14933 :: :
1031 03:50:14933 :: 'NoneType' object has no attribute 'Toggle'
1031 03:50:14933 ::

1031 03:50:18366 :: Traceback (most recent call last):

1031 03:50:18366 :: File "ui.py", line 1328, in CallEvent

1031 03:50:18366 :: File "ui.py", line 166, in __call__

1031 03:50:18366 :: File "ui.py", line 157, in __call__

1031 03:50:18366 :: File "uispeedbutton.py", line 104, in ButtonEvent

1031 03:50:18366 :: File "interfaceModule.py", line 630, in ToggleIkashopSearchShopBoard

1031 03:50:18366 :: AttributeError
1031 03:50:18366 :: :
1031 03:50:18366 :: 'NoneType' object has no attribute 'Toggle'
1031 03:50:18366 ::
 
Böyle uğraşana kadar constinfoya bağla sistemleri
constInfo. ORTALAMA = 1
bunlar gibi.
 
2:
Genişlet Daralt Kopyala
interfacemodule.py

#Arat
 wndspeed = uispeedbutton.SpeedButtonWindow()
      
#Değiştir
wndspeed = uispeedbutton.SpeedButtonWindow(self)


uispeedbutton.py

#Arat
    def __init__(self):

#Değiştir
    def __init__(self, interface):


#Arat
    def __init__(self, interface):

    #Altına ekle
        self.interface = interface



    def ButtonEvent(self,arg):
        if int(arg) == 1:
            if app.GetTime() > self.Button1_Timer:
                self.interface.ToggleIkashopSearchShopBoard()# Burası böyle kalsın
                self.Button2_Timer = app.GetTime() + 1
            else:
                Button1_TimerInfo = self.Button1_Timer - app.GetTime()
                chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.INFORMATION_TIME_CLICK % (Button1_TimerInfo))
 
Geri
Üst