Jump to content

North

Premium
  • Posts

    465
  • Joined

  • Last visited

  • Days Won

    10
  • Feedback

    0%

Posts posted by North

  1. Tryhard mode:

     

    [print ('self.SelectBtn{}[{}].SetEvent(ui.__mem_func__(self.EventProgress), "{}" , {})'.format(i,x,element,x) ) for element in ("mouse_click", "mouse_over_in", "mouse_over_out") for i in ("NameList","FaceList") for x in range(5)]

     

    Mission accomplished

     

    Do they require to be sorted in the output of @Tasho or it's ok like this aswell?

    P.s. it's ok for the offtopic, now the forum is ours the relase it's on the first post and the plebs are not gonna eventually use it because they don't know how. Fuck the staff it's never here.

    A n a r c h y in metin2dev

    • Love 2
  2. 15 hours ago, Syreldar said:

    I see, turns out i inadvertitely wrote it correctly without noticing Fleon forgot to remove double results on the array, he did

    
    eventlist = [ "mouse_click", "mouse_over_in", "mouse_over_out", "mouse_click", "mouse_over_in", "mouse_over_out"]

    I didn't notice, i directly wrote 

    
    eventlist = ["mouse_click", "mouse_over_in", "mouse_over_out"]

    which is correct following his code, that's why it worked for me.

    lol sorry about this i was super stoned and i didn't realize i was writing the same thing twice haha

    Both methods should be roughly the same for this kind of quantities but i can imagine in the whole process for someone it can matter

    Im glad that we can discuss about these things

  3. 12 hours ago, tierrilopes said:

    From:

    
    self.SelectBtnNameList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 0)
    		self.SelectBtnNameList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 1)
    		self.SelectBtnNameList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 2)
    		self.SelectBtnNameList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 3)
    		self.SelectBtnNameList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 4)
    		
    		self.SelectBtnNameList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
    		self.SelectBtnNameList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 1)
    		self.SelectBtnNameList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 2)
    		self.SelectBtnNameList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 3)
    		self.SelectBtnNameList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 4)
    		
    		self.SelectBtnNameList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
    		self.SelectBtnNameList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 1)
    		self.SelectBtnNameList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 2)
    		self.SelectBtnNameList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 3)
    		self.SelectBtnNameList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 4)
    		
    		self.SelectBtnFaceList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 0)
    		self.SelectBtnFaceList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 1)
    		self.SelectBtnFaceList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 2)
    		self.SelectBtnFaceList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 3)
    		self.SelectBtnFaceList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 4)
    		
    		self.SelectBtnFaceList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
    		self.SelectBtnFaceList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 1)
    		self.SelectBtnFaceList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 2)
    		self.SelectBtnFaceList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 3)
    		self.SelectBtnFaceList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 4)
    		
    		self.SelectBtnFaceList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
    		self.SelectBtnFaceList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 1)
    		self.SelectBtnFaceList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 2)
    		self.SelectBtnFaceList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 3)
    		self.SelectBtnFaceList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 4)

    Into:

    
    for i in xrange(5):
    	self.SelectBtnNameList[i].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", i)
    	self.SelectBtnNameList[i].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", i)
    	self.SelectBtnNameList[i].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", i)
    	self.SelectBtnFaceList[i].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", i)
    	self.SelectBtnFaceList[i].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", i)
    	self.SelectBtnFaceList[i].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", i)

    Couldnt write it in "one string" sadly, teach me how pls:(

     

     

    eventlist = [ "mouse_click", "mouse_over_in", "mouse_over_out", "mouse_click", "mouse_over_in", "mouse_over_out"]
    
    for element in eventlist:
    	for i in xrange(5):
    		self.SelectBtnNameList[i].SetEvent(ui.__mem_func__(self.EventProgress), element, i)




    This should do it, tested as follows (py36)
     

    eventlist = [ "mouse_click", "mouse_over_in", "mouse_over_out", "mouse_click", "mouse_over_in", "mouse_over_out"]
    
    for element in eventlist:
        for i in range(5):
            print("[{}] Element: {}".format(i,element))

     

  4. Thanks for the tips your suggestion are welcome, this was a bit ago and the overall knownledge is going up with the time.

    And sorry for the few weird things in the code aswell, it was structured differently at the beginning (video) and i kinda fast-review it a couple of months ago.

    Will edit the snippet with your suggestions asap (2 stoned atm)

    • Love 2
  5. Yo guys,

    here you have a script that i made to fix the annoying fact that epack32 craps out when you use for some reason uppercase extensions, this can happen with gr2's for example.

    Here you have a video showing how to use it properly, this is for an earlier version but you should get how it works.

    I'm also writing a py library that acts as manager for the query/msm/protos etc, the quality of the code is been improving since this script, stay tuned for the future.

     

    ## Author North - Fleon
    # Usage: python scriptname.py
    
    import os,fnmatch,shutil,re
    
    lenght = 3 # Set here the size of the extension, default 3
    extension = None;
    
    class FileManager():
        @staticmethod
        def Main():
            print("\n\n#### Extension to lowercase V.01 ####\n\n")
            print("Renames recursively from a caps extension to lower.")
            print("USAGE: Place your content and script into C:\workdir")
            print("The script will recursively change the extension to lower.")
            input(">>>> Press ENTER to continue...")
            # In case you are using a python version that is equal or lower than 2.7 please use raw_input instead of input above.
            FileManager.GetExtension()
            FileManager.GetLogFile()
            FileManager.RenameFile()
           
        def GetExtension():
            global extension
            global lenght
            while not extension or len(extension) > lenght:
                print("Tell me wich extension would you like to lower")
                print("/!\ The extension must not be left empty.")
                extension = str(input(">>>> Now type an extension: (Example: txt) \n"))
            return(extension)
       
       
        def GetLogFile():
            path = os.getcwd()
            global extension
            Extension = "*." + str(extension)
            with open("rename_log", "w") as File_txt:
                for root, dirnames, filenames in os.walk(path):
                    for gr2 in fnmatch.filter(filenames, Extension):
                        write_txt = (os.path.join(root, gr2) +"\n")
                        File_txt.write(write_txt)
                       
        def RenameFile():
            global extension
            with open("rename_log", "r") as file_directory:
                for element in file_directory:
                    element = element[:-1]
                    ren_element = element.replace(str.upper(extension), str.lower(extension))
                    os.rename(element, ren_element)
                    print(">>>> This file has been renamed: " + element)       
            total_elements = sum(1 for line in open('rename_log'))   
            print("Total renamed files: {0}".format(str(total_elements)))
    
    FileManager.Main()
    

     

    • Love 2
  6. On 1/11/2018 at 2:17 PM, dextr said:

    I tried to put the Sash System by Lennt, but my Python doesn't work, here is the Syserr:

      Hide contents

    0111 20:28:07528 :: 
    networkModule.py(line:208) SetSelectCharacterPhase
    system.py(line:130) __pack_import

    networkModule.SetSelectCharacterPhase - exceptions.SyntaxError:invalid syntax (line 773)

    0111 20:28:07528 :: ============================================================================================================
    0111 20:28:07528 :: Abort!!!!

     

    Kind Regards

     

    .Dex

    The solution is simple you can gather the error from the traceback, basically you have to delete the file networkmodule.py.

    This will fix the issue

  7. On 12/12/2017 at 4:46 PM, Sumnix said:
    
    1212 19:40:11992 :: Traceback (most recent call last):
    
    1212 19:40:11993 ::   File "game.py", line 1314, in OnMouseLeftButtonUp
    
    1212 19:40:11993 ::   File "game.py", line 1351, in __PutItem
    
    1212 19:40:11993 ::   File "game.py", line 1426, in __DropItem
    
    1212 19:40:11993 :: TypeError
    1212 19:40:11993 :: : 
    1212 19:40:11993 :: Open() takes at least 3 arguments (1 given)
    1212 19:40:11993 :: 

     

    He stated clearly that you have to call it differently from your previous Open().
     

    Just call the others, 

    Mydick = ItemQuestionDialog() # Should be already done in game.py
    Mydick.Open(vnum, slot, text)

    Didnt test but it should work

  8. Just to let the others be aware aswell, you can easily get the output of your cmd builtin ping since i don't think you want to implement everything by yourself.

    im ATM on linux for win will be slightly different.
     

    import subprocess
    
    p = subprocess.Popen(["ping","www.google.com"], stdout=subprocess.PIPE)
    print p.communicate()
    ### Output ###
    
    >>> print p.communicate()
    ('\n--- www.google.com ping statistics ---\n31 packets transmitted, 31 received, 0% packet loss, time 30042ms\nrtt min/avg/max/mdev = 2.942/4.227/30.166/4.793 ms\n', None)
    
    

     

  9. quest give_basic_weapon begin
        state start begin
            when login with pc.getqf("basicweapon") == 0 begin
    			say_title("Server namerino")
    			say("Welcome to serverino, you warriorerino")
    			say("")
    			say_reward("Itemerino getterino")
    			
                if pc.job == 0 then
                    pc.give_item2(11206, 1)
                    pc.give_item2(16, 1)			
    			elseif pc.job == 1 then    
    				pc.give_item2(11406, 1)
    				pc.give_item2(2006, 1)
    				pc.give_item2(1006, 1)
    				pc.give_item2(12346, 1)
    				pc.give_item2(8000, 200)				
    			elseif pc.job == 2 then
    				pc.give_item2(11606, 1)
    				pc.give_item2(16, 1)
    				pc.give_item2(12486, 1)				
    			elseif pc.job == 3 then
    				pc.give_item2(11806, 1)
    				pc.give_item2(7006, 1)
    				pc.give_item2(12626, 1)				
    				end
    			
    			pc.give_item2(13006 , 1)
    			pc.give_item2(14006 , 1)
    			pc.give_item2(15006 , 1)
    			pc.give_item2(16006 , 1)
    			pc.give_item2(17006 , 1)
    			pc.give_item2(70038 , 50)
    			pc.give_item2(72723 , 1)
    			pc.give_item2(72727 , 1)
    			pc.setqf("basicweapon", 1)	
            end
        end

    I'm no lua coder/whatever but now should do the trick.

    P.s. not tested but idk if you have to end the elseif's, test it

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.