[HELP]Threading and Timer Object in Python script

06/01/2012 12:48 FSXraptor#1
Hi all, I am trying to implement a timer in a while loop to put a time limit in Guild accept war declare. I need to execute the loop 1 time every second so it must be delayed by the timer object.


Code:
def __GuildWar_OpenAskDialog(self, guildID, warType):

    #code
    #code etc
    
    time = 31
    while time > 0:
        chat.AppendChat(chat.CHAT_TYPE_INFO, "Remaining %s seconds." % (time))
        self.t = threading.Timer(1, __somedef)
        self.t.start()
        time = time -1

But if I try
Code:
import Threading
or
Code:
from threading import timer
i get an error from client, says
Code:
no module named 'threading'
If I user time.sleep(1) then the game freezes, so it don't work.

Is there any way to add the threading module in the client libs? I believe that metin2 runs on Python 2.2 which by default does not have the threading module.
Thanks
06/02/2012 18:33 FSXraptor#2
up