Hey, you can actually make it with type condition for equipment only instead of inserting them in list, and get only the last digit of the vnum
Welcome on epvp
____________________________________
I write this as request of one guy from skype and i made via teamviewer on him pc in some minutes, i not spend my time to do the best method for one release, but code works ok and nothing "is so bad", be happy is for free, because some people try to sell things like this **** for money, and also i not request your money for that, is a simple release, you not need to say 'Hey noob' because you not like method or release, exist button exit and leave this page.
When a release is posted free is not importantly method what you used If them do same.
In programming exist a lot a method for make one thing, so you not need to be sad about that, go to sleep and all is done.
I write this as request of one guy from skype and i made via teamviewer on him pc in some minutes, i not spend my time to do the best method for one release, but code works ok and nothing "is so bad", be happy is for free, because some people try to sell things like this shit for money, and also i not request your money for that, is a simple release, you not need to say 'Hey noob' because you not like method or release, exist button exit and leave this page.
This is him server and him client, and he added rest of vnums in list not me, because i not tested nothing on my pc because my dedicated server is offline since 5 days. ^^
Quote:
Originally Posted by Exygo
And the final code:
Code:
# Exygo append item quality
def AppendItemQualityRate(self, vnum):
itemType = item.GetItemType()
if itemType in (item.ITEM_TYPE_WEAPON,item.ITEM_TYPE_ARMOR):
max_quality = 9 # +9
# window
xPosStep = 0
yPosStep = self.toolTipHeight
# stars
xPos = 0
window = ui.MakeWindow(self,xPosStep,yPosStep,17*max_quality,17)
window.SetWindowHorizontalAlignCenter()
for n in xrange(max_quality):
if n < int(str(vnum)[-1:]):
image = ui.MakeImageBox(window,"exygo/icon/stars/1.tga",xPos,0)
else:
image = ui.MakeImageBox(window,"exygo/icon/stars/0.tga",xPos,0)
xPos += 17
self.childrenList.append(image)
self.childrenList.append(window)
self.toolTipHeight += self.TEXT_LINE_HEIGHT
self.ResizeToolTip()
Ohh br0..
You can test execution timer and you will get a rekt alone.
If you not understand how it works code and what he do, no try to speak about that.
Your method is a best of shit what i see in my life.
Stop to kill python again.
I could easily do what you want to say, but it sucks.
This feature has no charm if for all items.
This feature is only for some special items to be highlighted more than their value, it is a matter of design something that helps players way because players can see the extent of the item in the name of that item.
So this is the method to be used by any server.
With my code they can add what theywant.
Example, you need only to add the first element from vnum what you want to start stars and automatically will up by range vnum min/max, you need only to declare the first element (that means min) and will be up to max. I did this because the guy for what i make he not was want for all items or special category, he was want only for specials items from list (items what can be evolution), and as i say you can put in list for bracelet, index: [14205], and automatically will be work only for [14205 -> 14209] and will show you corectly stars.
Ok now i will explain you how it works this code.
Code:
for k in xrange(player.MAX_REFINE_VNUM + 1): # Make a loop from +MIN to +MAX.
for v in xrange(len(vnums)): # Returns the number of elements(vnums) in the list.
tokens = vnums[v] # Get the index vnum from list.
var = str(itemVnum)[-1:] # Get last digit from vnum [MIN - MAX] and convert in string.
it = str(k) # Convert iterator k [MIN - MAX] in string.
(tokens <= itemVnum and itemVnum <= tokens + 9) # Calculate itemVnum value min/max if exist in range.
(var == it) # When last digit is equal with iterator
image.LoadImage("icon/item/features_tooltip/%d.tga" % (k)) # Append image from iterator [MIN - MAX]
vnums = [14205, 11806, 140, 12012, 184]
# What means this list.
# Element 14205 means will have check from 14205 to 14209.
# Element 11802 means will have check from 11802 to 11809.
# Element 140 means will have check from 140 to 149.
Code:
def __SetFeaturesToolTip(self, itemVnum):
vnums = [140, 150, 3130, 270, 12010, 12020, 12030, 12040, 480, 460, 470, 5120, 7120, 20250, 20750, 20000, 180, 190]
for k in xrange(player.MAX_REFINE_VNUM + 1):
for v in xrange(len(vnums)):
tokens, var, it = vnums[v], str(itemVnum)[-1:], str(k)
if ((tokens <= itemVnum and itemVnum <= tokens + 9) and (var == it)):
image.LoadImage("icon/item/features_tooltip/%d.tga" % (k))
Stop this circus you will not get anything already is too off-topic.
Using what method and what code you want, nobody care about you.
Have fun and sorry for my english.
Oh yeah, i did 10 images, what is your problem xD, you can't sleep?
I see you edit your post every 2 seconds, and you make refresh on every one second on this topic, so bad..you are hungry ^^
I notice that despite mills, because you're obsessed, you made 100 reply to showing a ****, which has no a thing about it, it ceases to kill python.
EDIT:
That is all over 35 lines with code **** for what?
Here is better dude, stop to make a post with a lot a things **** what people not will use.
Code:
def __SetFeaturesToolTip(self, itemVnum):
vnums = [140, 150, 3130, 270, 12010, 12020, 12030, 12040, 480, 460, 470, 5120, 7120, 20250, 20750, 20000, 180, 190]
for k in xrange(player.MAX_REFINE_VNUM + 1):
for v in xrange(len(vnums)):
tokens, var, it = vnums[v], str(itemVnum)[-1:], str(k)
if ((tokens <= itemVnum and itemVnum <= tokens + 9) and (var == it)):
image.LoadImage("icon/item/features_tooltip/%d.tga" % (k))
Stop to search attention with my name.
As i see you check my profile on some forums in every day and my website, you really have a obsessed for me, thanks.
Using what method and what code you want, nobody care about you.
Stop to try continue conversation with me, if you want to speak with me about personal things like what you did now, you can write me a message private, no need to search attention here, already you get some popularity here from this conversation with me, good luck.
I just see someone who use code from another to do do someting.
Sorry, but Vegas is not my friend, but since some days ( no, week) I think he is the only one who's always posted something without waiting something from the other.
You cry about his code, but sorry, if the code look really ugly for you, just change it for your server, like some people do without say someting.
For me both of your examples arent really good coded. I mean there is allways something to do better. Beeing sad because someone says your code is **** is as stupid as saying his code is ****, mine is better.
So actually just see it as something you could might learn and not as a kinda "i am better than you".
because coding simply isnt about competition. If it works and it works fine, why should you then be sad?
I mean for example i would write it like this:
Code:
def __IsCustomStarVnum(self, vnum):
customs=[10, 20, 30, 40]
vnum = int("%s0" % str(vnum)[:-1])
if vnum in customs:
return TRUE
return FALSE
def __IsCustomStarType(self, vnum):
allowed_types = [item.ITEM_TYPE_WEAPON,item.ITEM_TYPE_ARMOR]
return (item.GetItemType() in allowed_types)
def __IsCustomStarItem(self, vnum, type):
x = self.__IsCustomStarType(vnum)
y = self.__IsCustomStarVnum(vnum)
if type == 2:
return x
if type == 1:
return y
if type == 0:
return x or y
return FALSE
def __SetStars(self, vnum, type = 0):
#0 = use customTypes and Itemtype #1 = Use ItemType #2 = use customtype
grd = int(str(vnum)[-1:])
if self.__IsCustomStarItem(vnum, type):
img = ui.ImageBox()
img.SetParent(self)
img.Show()
mage.LoadImage("icon/item/features_tooltip/%d.tga" % (grd))
img.SetPosition(self.toolTipWidth/2 - 75, self.toolTipHeight)
self.toolTipHeight += 18
self.childrenList.append(img)
self.ResizeToolTip()
But its up to everyone what he wants to use.
but one thing i actually dont get:
Why do you both use an for loop when there is no need for it?
I mean for rarity 9 you dont need to append all images from 0-9, its enough to show image 9.tga ?
Python Problem Tooltip 07/07/2016 - Metin2 Private Server - 3 Replies Hallo Liebe Community,
Ich hab sowas ähnliches wie ein Wiki wenn man über das Item mit Maus drüber fährt wurde dann ja die Bonis und so des Items angezeigt aber seid dem ich das Schulterbandsystem drin hab kommt mir der Fehler:
0706 20:09:38364 :: IndexError
0706 20:09:38364 :: :
0706 20:09:38364 :: list index out of range
[Python]Item Tooltip auf einen Button 03/09/2016 - Metin2 Private Server - 4 Replies Hallo,
Ich möchte in Python einen Button machen und als Tooltip soll wie bei einem richtigen Item die Beschreibung kommen. Allerdings will ich dort den Text noch etwas verändern.
Wäre nett wenn mir jemand helfen könnte^^
[Python]Frage Button Tooltip 09/24/2015 - Metin2 Private Server - 2 Replies Hey leutzz,
Ich hab mal ne Frage,
Von dem Abschiedsrelease (Killroy.) hab ich mir das Sideboard gezogen und es eingefügt. Ich würd gern ein Button Tooltip rein haben, funktioniert jedoch nich so ganz. Ich hab die python datei von ihm schon ein wenig abgeändert aber es will nicht rein gehen. Im syserr steht nix diesbezüglich.
Hier meine .py datei:
import ui
import dbg
Tooltip auf Label 10/22/2011 - AutoIt - 7 Replies Hallo Epvp...
Ich wollte mal fragen , ob man ein Tooltip erstellen kann , dass
nur erscheint , wenn die Maus auf einem BEstimmtem Label
zeigt / steht.....
Danke :D
Edit script in python and add features. 11/23/2010 - Metin2 Private Server - 0 Replies Hello.
Is it to add to this script, python,
import serverInfo
serverNum=`
serverChannel=1
addr_new = serverInfo.REGION_DICT
port_new = serverInfo.REGION_DICT
account_addr_new = serverInfo.REGION_AUTH_SERVER_DICT
account_port_new = serverInfo.REGION_AUTH_SERVER_DICT
addr=addr_new