Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2
You last visited: Today at 06:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Improve the performance of the script + wh

Discussion on Improve the performance of the script + wh within the Metin2 forum part of the Popular Games category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2023
Posts: 2
Received Thanks: 0
Improve the performance of the script + wh

Hello ePVPers,

I made a script to get the position of the player and set pixel position via the target coords.

Quote:
GameFunctions::getpixelpoz getpixelpoz{};

/* GameFunctions::getpixelpoz GameFunctions::PixelPosition(long vid) {
PyObject* pixelpoz = PyObject_GetAttrString(gf.chr, "GetPixelPosition");
PyObject* args = PyTuple_Pack(1, PyInt_FromLong(vid));
PyObject* ppoz = PyObject_Call(pixelpoz, args, NULL);
getpixelpoz ppozstruct{};
ppozstruct.x = PyInt_AsLong(PyTuple_GetItem(ppoz, 0));
ppozstruct.y = PyInt_AsLong(PyTuple_GetItem(ppoz, 1));
Py_XDECREF(ppoz);
Py_XDECREF(args);
Py_XDECREF(pixelpoz);
return ppozstruct;
}; */
GameFunctions::setplayerpoz setplayerpoz{};
/*
void GameFunctions::setcharacterpoz(long x, long y, long z)
{
PyObject* PixelPozSet = PyObject_GetAttrString(gf.chr, "SetPixelPosition");
PyObject* args = PyTuple_Pack(3, PyLong_FromLong(x), PyLong_FromLong(y), PyLong_FromLong(z));
PyObject* set_result = PyObject_CallObject(PixelPozSet, args);
Py_XDECREF(args);
Py_XDECREF(set_result);
Py_XDECREF(PixelPozSet);
};
GameFunctions gamefunc;
The getpixelpoz - gets the value of the selected target and passes it into the setcharacterpoz to teleport to the target

Calling the function:

Quote:
int targetid = gamefunc.GetTargetVid();
gamefunc.setcharacterpoz(getpixelpoz.x +10, abs(getpixelpoz.y),1);
packet.SendAttackPacket((void*)packet.networkA4, 0, targetid);
Sometimes it works sometimes it returns a crash. can you advice me in increasing the performance of the script?

Additionally i wanted to get all the mobs around the player but cannot figure it how to do it so I took this aproach:

Quote:
int index = gamefunc.GetMainPlayerIndex();

for (long i = index - 200000; i < index + 100000; i += 2)
{
float distance= functions.GetCharacterDistance(i);
if (distance> 0 && distance < 1000 && gamefunc.IsEnemy == 1 && gamefunc.GetInstanceType == 0)
{
packet.SendAttackPacket((void*)vb.networkA4, 0, i);
}
}
But it returns in a crash because of the computation time i think, so its not a good aproach.
oache2 is offline  
Reply

Tags
improve performance


Similar Threads Similar Threads
Guide to improve your game performance.
03/05/2014 - S4 League - 7 Replies
Disable Nagel's algorithm - Lowers your ping Nagle's algorithm, named after John Nagle, is a means of improving the efficiency of TCP/IP networks by reducing the number of packets that need to be sent over the network. Nagle's document, Congestion Control in IP/TCP Internetworks describes what he called the "small packet problem", where an application repeatedly emits data in small chunks, frequently only 1 byte in size. Since TCP packets have a 40 byte header (20 bytes for TCP, 20 bytes...
short question improve vmware performance
05/20/2012 - League of Legends - 3 Replies
so my question is is it possible to change that high cpu intensive stuff on the map /champ and change it to like just a black image?(in my opinion simple black > 2 milion colors on the map) its like switch from verry low setings to even lower is it possible? just like we did to the start image(that cpu intensive when you login or from the main page on league of legends client the one with the start boton(after you loged in) thanks and sorry for bad english, if you guys dont...
Improve Your Computer Performance
06/13/2007 - Silkroad Online - 21 Replies
Well I'm starting this thread because ozzie thinks that ram optimizers are the way to go when u want performance, I said it in his thread and I'll say it here: Anyone that understands the least about how ram works will tell u that ram optimizer tools are bs. Yes, they free ram (or they say they do in their graph), but at what cost? The best ram optimizers are those that do nothing (kinda like a placebo), and the worse ones just reduce your system performance. Just think about it: Why do u...



All times are GMT +1. The time now is 06:46.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.