Premium North 1179 Posted February 3, 2018 Premium Share Posted February 3, 2018 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)) Link to comment Share on other sites More sharing options...
Premium Domniq 929 Posted February 3, 2018 Premium Share Posted February 3, 2018 That's my way I did year ago, same ingame output as gf There are 2 additional images covering the button so you can just disable "mouse over" for this elements (3 lines of code instead of creating functions etc.) for i in xrange(len(self.NameList)): self.SelectBtnFaceList[i].AddFlag("not_pick") self.SelectBtnNameList[i].AddFlag("not_pick") Link to comment Share on other sites More sharing options...
Premium tierrilopes 452 Posted February 3, 2018 Premium Share Posted February 3, 2018 45 minutes ago, Fleon said: 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)) Now lets import that code from an url so that it becames 'one string' Link to comment Share on other sites More sharing options...
PeaceMaker 121 Posted February 3, 2018 Share Posted February 3, 2018 i feel sad for the guy who did this mistake , he probably got kicked out from work ! Link to comment Share on other sites More sharing options...
Tasho 243 Posted February 3, 2018 Share Posted February 3, 2018 (edited) 1 hour ago, Nevisor said: That's my way I did year ago (same results) for i in xrange(len(self.NameList)): self.SelectBtnFaceList[i].AddFlag("not_pick") self.SelectBtnNameList[i].AddFlag("not_pick") That's not related with what he request. 2 hours ago, Fleon said: 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) Doesn't looks exactly with what we need, and your loop will be very bad, repeat it x30 times for each one, and don't to the same. (http://tpcg.io/C4Vv2s) That's like how should be. # No comprehension for eventKey, (srcNameList, srcFaceList) in enumerate(zip(self.SelectBtnNameList, self.SelectBtnFaceList)): for eventName in ('mouse_click', 'mouse_over_in', 'mouse_over_out'): (srcNameList.SetEvent(eventKey, eventName), srcFaceList.SetEvent(eventKey, eventName)) # Comprehension [(srcNameList.SetEvent(eventKey, eventName), srcFaceList.SetEvent(eventKey, eventName)) for eventKey, (srcNameList, srcFaceList) in enumerate(zip(self.SelectBtnNameList, self.SelectBtnFaceList)) for eventName in ('mouse_click', 'mouse_over_in', 'mouse_over_out')] Thanks @VegaS PS: Let's don't make another replies about that. Let's go on https://metin2dev.org/board/index.php?/forum/34-offtopic/ and make one topic and we can talk 24/7 about that. Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Premium tierrilopes 452 Posted February 3, 2018 Premium Share Posted February 3, 2018 Thanks. Link to comment Share on other sites More sharing options...
Premium Syreldar 1876 Posted February 3, 2018 Premium Share Posted February 3, 2018 On 2/3/2018 at 7:39 PM, Tasho said: That's not related with what he request. Doesn't looks exactly with what we need, and your loop will be very bad, repeat it x30 times for each one, and don't to the same. (http://tpcg.io/C4Vv2s) That's like how should be. # No comprehension for eventKey, (srcNameList, srcFaceList) in enumerate(zip(self.SelectBtnNameList, self.SelectBtnFaceList)): for eventName in ('mouse_click', 'mouse_over_in', 'mouse_over_out'): (srcNameList.SetEvent(eventKey, eventName), srcFaceList.SetEvent(eventKey, eventName)) # Comprehension [(srcNameList.SetEvent(eventKey, eventName), srcFaceList.SetEvent(eventKey, eventName)) for eventKey, (srcNameList, srcFaceList) in enumerate(zip(self.SelectBtnNameList, self.SelectBtnFaceList)) for eventName in ('mouse_click', 'mouse_over_in', 'mouse_over_out')] Thanks @VegaS PS: Let's don't make another replies about that. Let's go on https://metin2dev.org/board/index.php?/forum/34-offtopic/ and make one topic and we can talk 24/7 about that. ? Don't know what you are talking about, really, his method works perfectly and it's easy as fuck to comprehend. "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
Tasho 243 Posted February 3, 2018 Share Posted February 3, 2018 10 minutes ago, Syreldar said: Don't know what are you talking about, really, his method works perfectly and it's easy as fuck to comprehend. Add the self.SelectBtnFaceList on print too,, and run it, you will get a loop of x60 times (repeat x2 same thing), when need just x30 times. - Run it: http://tpcg.io/C4Vv2s Do you think that's a good loop? what's about that eventList items? Read with careful how should be output on my image. 1 Link to comment Share on other sites More sharing options...
Premium Syreldar 1876 Posted February 3, 2018 Premium Share Posted February 3, 2018 On 2/3/2018 at 9:03 PM, Tasho said: Add the self.SelectBtnFaceList on print too,, and run it, you will get a loop of x60 times (repeat x2 same thing), when need just x30 times. - Run it: http://tpcg.io/C4Vv2s Do you think that's a good loop? what's about that eventList items? Read with careful how should be output on my image. It's printing 60 times instead of 30 because you are asking it to print it twice lol Screenshot from your link: while this is what fleon did: So yeah..dunno what are you doing. "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
Tasho 243 Posted February 3, 2018 Share Posted February 3, 2018 (edited) 9 minutes ago, Syreldar said: It's printing 60 times instead of 30 because you are asking it to print it twice lol Ok then, maybe i'm noob. Put the final code (for metin2, not print function) to SetEvent on the both list (self.SelectBtnNameList, self.SelectBtnFaceList) with good arguments, like that. Spoiler I think you don't understand how exactly need to work, please read again every row from my output. Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium Syreldar 1876 Posted February 3, 2018 Premium Share Posted February 3, 2018 9 minutes ago, Tasho said: I think you don't understand how exactly need to work It works perfectly lol "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
Tasho 243 Posted February 3, 2018 Share Posted February 3, 2018 1 minute ago, Syreldar said: It works perfectly lol No isn't, please post the code for both list to SetEvent (metin2), and i will show you what "perfectly is". Link to comment Share on other sites More sharing options...
Premium tierrilopes 452 Posted February 3, 2018 Premium Share Posted February 3, 2018 On 2/3/2018 at 9:04 PM, Syreldar said: It's printing 60 times instead of 30 because you are asking it to print it twice lol Screenshot from your link: while this is what fleon did: So yeah..dunno what are you doing. Probably thats because Fleon only did it for the "self.SelectBtnNameList" but forgot the "self.SelectBtnFaceList" Print example gives the idea, he just didnt edited the first code Using list i prefer (with print to python run thing): txtlist = [ "mouse_click", "mouse_over_in", "mouse_over_out"] for loop in txtlist: for i in range(5): print 'self.SelectBtnNameList[{}].SetEvent(ui.__mem_func__(self.EventProgress), "{}", {})'.format(i, loop, i) print 'self.SelectBtnFaceList[{}].SetEvent(ui.__mem_func__(self.EventProgress), "{}", {})'.format(i, loop, i) Not organized by category like in the above example, but for me its faster to write. 2 Link to comment Share on other sites More sharing options...
Premium Syreldar 1876 Posted February 3, 2018 Premium Share Posted February 3, 2018 28 minutes ago, tierrilopes said: Probably thats because Fleon only did it for the "self.SelectBtnNameList" but forgot the "self.SelectBtnFaceList" Print example gives the idea, he just didnt edited the first code Using list i prefer (with print to python run thing): txtlist = [ "mouse_click", "mouse_over_in", "mouse_over_out"] for loop in txtlist: for i in range(5): print 'self.SelectBtnNameList[{}].SetEvent(ui.__mem_func__(self.EventProgress), "{}", {})'.format(i, loop, i) print 'self.SelectBtnFaceList[{}].SetEvent(ui.__mem_func__(self.EventProgress), "{}", {})'.format(i, loop, i) Not organized by category like in the above example, but for me its faster to write. 5 5 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. 1 "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
Active+ Member Abel(Tiger) 1198 Posted February 3, 2018 Author Active+ Member Share Posted February 3, 2018 --- 0.0420000553131 seconds tierrilopes execution time --- --- 0.0659999847412 seconds Tasho execution time --- Who the f**k care about 0.02 seconds ? You can do a lot of things in those seconds ... Rewrite an entire file and then you see a difference , not from 2 code lines. 2 1 Link to comment Share on other sites More sharing options...
Forum Moderator Raylee 656 Posted February 4, 2018 Forum Moderator Share Posted February 4, 2018 Am 02.02.2018 um 17:38 schrieb Abel(Tiger): I think they forgot to cythonize =)) I don't recommend to use that code, is ugly ... This is the hidden content, please Sign In or Sign Up Unsichtbaren Inhalt anzeigen Awesome stuff: uikeychange.py => Line 203 =)) Good work. Thank you Best regards Raylee Link to comment Share on other sites More sharing options...
Premium North 1179 Posted February 4, 2018 Premium Share Posted February 4, 2018 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 Link to comment Share on other sites More sharing options...
Premium North 1179 Posted February 4, 2018 Premium Share Posted February 4, 2018 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 2 Link to comment Share on other sites More sharing options...
ѕeмa™ 308 Posted February 4, 2018 Share Posted February 4, 2018 Ok so, who of you have it bigger? 6 https://m2admin.net/ Link to comment Share on other sites More sharing options...
Premium tierrilopes 452 Posted February 4, 2018 Premium Share Posted February 4, 2018 24 minutes ago, ѕeмa™ said: Ok so, who of you have it bigger? 1 Link to comment Share on other sites More sharing options...
Honorable Member martysama0134 7180 Posted February 5, 2018 Honorable Member Share Posted February 5, 2018 (edited) On 4/2/2018 at 3:24 PM, ѕeмa™ said: Ok so, who of you have it bigger? Definitely DevDick. You can find him several times dicking around in this new leaked root: (screenshot by Syreldar) Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal 15 Check out my GitHub Link to comment Share on other sites More sharing options...
GostMan 0 Posted February 24, 2018 Share Posted February 24, 2018 Honestly I just registered to call you guys a bunch of dumbasses... So you have code that will look like: print1 print2 print3 vs code that you think is better and looks better because its a simple line: for {x=0} {x<=3;print$x} {x++} damn sure it'll look better... but when you have servers with over 10k people on at the same time with tcp/udp connections.. do looks matter vs performance? that's what you guys should be thinking about 1 Link to comment Share on other sites More sharing options...
Tasho 243 Posted February 24, 2018 Share Posted February 24, 2018 @GostMan Stop using fake account. You are the most of *dum.... from here, because you didn't really understand the sarcasm which @tierrilopes created it, a guy say on first page: "i can write better the code of official and things which containing a lot a lines I can do on one line.", but he doesn't have idea about coding. And from here start some examples from us and make fun about situation, what's your problem? Oh let me know..you are frustrated because you don't understand how it's working the code from us examples? Don't try to look smart than us because you aren't, don't come with examples of another language if there's all about Python. That one line here is called as "comprehension python list". For simple conditions is ok to use it, but on that case from the previous replies for multiple function to be called doesn't look very good and should stay on normally style. I'm not sure but you are looking like a romanian which didn't eat nothing since a lot a time. You should stop do spam without sense after some weeks just because you are frustrated, if all people do that which all what they don't like it and hate it what happens with community? If I hate something from guys which talking on some topics should I check now all topics and go and say them "yo guys, you are *dum...? Was ok if you was registered when we was had that discussion, not after some weeks. Have fun. 2 Link to comment Share on other sites More sharing options...
GostMan 0 Posted February 24, 2018 Share Posted February 24, 2018 37 minutes ago, Tasho said: @GostMan Stop using fake account. You are the most of *dum.... from here, because you didn't really understand the sarcasm which @tierrilopes created it, a guy say on first page: "i can write better the code of official and things which containing a lot a lines I can do on one line.", but he doesn't have idea about coding. And from here start some examples from us and make fun about situation, what's your problem? Oh let me know..you are frustrated because you don't understand how it's working the code from us examples? Don't try to look smart than us because you aren't, don't come with examples of another language if there's all about Python. That one line here is called as "comprehension python list". For simple conditions is ok to use it, but on that case from the previous replies for multiple function to be called doesn't look very good and should stay on normally style. I'm not sure but you are looking like a romanian which didn't eat nothing since a lot a time. You should stop do spam without sense after some weeks just because you are frustrated, if all people do that which all what they don't like it and hate it what happens with community? If I hate something from guys which talking on some topics should I check now all topics and go and say them "yo guys, you are *dum...? Was ok if you was registered when we was had that discussion, not after some weeks. Have fun. Maybe you should start by reading some book on "how to grasp the english language" before you come around talking shit? as far as examples go..pretty much most languages are the same...imports/defines/if/then/else/functions/pointers?/arrays/lists and lots of rock music in between funny how you accused me of having a fake account..then of not understanding sarcasm that wasnt?!? then of not being a python coder when i didn't give you an example in any language at all..just the theory itself... as far as I know this is an open forum..you don't like being called a dumbass and now a moron and a racist? then its VERY simple: don't act like one Link to comment Share on other sites More sharing options...
Premium tierrilopes 452 Posted February 24, 2018 Premium Share Posted February 24, 2018 <<Thou shall not joke again>> Link to comment Share on other sites More sharing options...
Recommended Posts