Discussion on [mini func](int(bool)) player.IsAntiFlagBySlot(iSlot, iAntiFlag) within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
But wait, what would you do if the item is not in the inventory?
For example dragon soul inventory and so on. As may you know the ItemPos isn't finished so, the equipments and belt-items are part of the inventory, but in fact you cannot use the function for other windows in this way. I personally don't prefer the use of selectitem either.
And this isn't good either:
Code:
int iSlotIndex;
if(!PyTuple_GetInteger(poArgs, 0, &iSlotIndex))
return Py_BuildException();
int iFlag;
if(!PyTuple_GetInteger(poArgs, 0, &iFlag))
return Py_BadArgument();
But wait, what would you do if the item is not in the inventory?
For example dragon soul inventory and so on. As may you know the ItemPos isn't finished so, the equipments and belt-items are part of the inventory, but in fact you cannot use the function for other windows in this way. I personally don't prefer the use of selectitem either.
And this isn't good either:
Code:
int iSlotIndex;
if(!PyTuple_GetInteger(poArgs, 0, &iSlotIndex))
return Py_BuildException();
int iFlag;
if(!PyTuple_GetInteger(poArgs, 0, &iFlag))
return Py_BadArgument();
If you give a look at PyObject * playerGetItemIndex(..) - it's the same.
Code:
switch (PyTuple_Size(poArgs))
{
case 1:
{
int iSlotIndex;
if (!PyTuple_GetInteger(poArgs, 0, &iSlotIndex))
return Py_BuildException();
int ItemIndex = CPythonPlayer::Instance().GetItemIndex(TItemPos (INVENTORY, iSlotIndex));
return Py_BuildValue("i", ItemIndex);
}
case 2:
{ ... }
default:
return Py_BuildException();
}
int ItemIndex = CPythonPlayer::Instance().GetItemIndex(TItemPos (INVENTORY, iSlotIndex));
Now, when you ask yourself, "Why is he doing something new for this?"
I'm about to use the newer root python files. And that, without great changes to the Python code.
example:
Code:
if app.WJ_ENABLE_TRADABLE_ICON:
def CantCheckInItem(self, slotIndex):
itemIndex = player.GetItemIndex(slotIndex)
if itemIndex:
return player.IsAntiFlagBySlot(slotIndex, item.ANTIFLAG_SAFEBOX)
But yeah, one fact is true though. This function is used by uiExchange, uiPrivateShopBuilder, uiSafeBox. So yeah, I have to change something, 'cause I saw that the function is used after following if-clause:
Code:
if (player.SLOT_TYPE_INVENTORY == attachedSlotType
or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType):
I wasn't against you, I just told you what have you done with the code, is that bad? Why did you take it too serious? I know why we need this, I already wrote it when I saw it in the official binary at the first time.
If you have couple of minutes take a look on this video, I can prove the official version here:
I made it with an old binary, because that is almost the same like the public untouched source +/- sash and so on and the current has a lots of changed structures already included the TItemData also. Oh yeah and sorry for that but I almost forgot how to get the virtual function table in ida I'm tired x(
[Mini-Release] Perc_Chance-Funktion (bool return) 05/05/2015 - Metin2 PServer Guides & Strategies - 7 Replies Muss man wohl nicht viel zu sagen. Ist einfach dazu da, um bei Chancen unter 1% nicht mit number(1, 1000) usw. rechnen zu müssen.
function math.chance(i)
return math.random() <= (i/100)
end
So benutzbar:
if math.chance(0.0001) then
trifft zu, wenn die Chance von 0.0001 zutrifft.
Func nach der func ausführen problem 08/15/2011 - AutoIt - 6 Replies Hi,
ich hab hier mal nen code schnipel der nicht funktioniert..
Die error Erkennung...
if StringInStr($oWebTcp.body, "Du kannst nicht weitermachen...") Then
GUICtrlSetData($list1, "Login failed. Please fix"&" = "&$array&" ANR: ")
Func in Func ? 02/11/2011 - AutoIt - 8 Replies Hallo E*PvP,
Ich habe eine frage ,
ich will ein shortcut ..ding machen ..xD
also wen ich z.b F1 drücke,soll ich in ein Menü reinkommen und dan auch für F1 etwas anderes amchen also z.b
F1= Begrüßungs hotkeys => Press F1 =>
[Fragen zu] Gui Hide & Show / Admin Rights / Func in Func 12/12/2010 - AutoIt - 29 Replies Hi Leute,
wie ihr oben ja bereits lesen könnt habe ich ein paar Fragen.
1. Könnte mir jmd. eine Hotkeyset-Func schreiben, womit ich mit nur einer (!) Taste die GUI verstecken und wieder anzeigen lassen kann ?
2. Gibt es etwas, dass dem gescripteten Tool von selbst Adminrechte verschafft? Ich rede NICHT von RequireAdmin, da muss man ja Administrator des PCs sein.
€:
Kann "#requireadmin" rausgezögert werden ?!
Ich möchte, dass das passiert, aber erst, wenn ich einen Knopf gedrückt...