Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 00:58

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

Advertisement



Bot development

Discussion on Bot development within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2011
Posts: 10
Received Thanks: 1
Lightbulb Bot development

Hey guys,
I wanted to start a Nostale bot project in Python. I already developed a dll injector to use the packet logger by BladeTiger12. I also started to build my own UI which at this point can only send packets via the tcp feature of the packet logger.


Now im a bit stuck. I don't get how i can make my character attack monsters (experimented a bit with the ncif packet but didn't get any result). Neither i have any idea how to implement a map to click on (to set waypoints to walk to) as seen in other Nostale bots for example the clientless bot by Pumba and many more. Anoter question i have is: how do i get the characters hp to know when to use a healing potion. I would appreciate any help or tips for my project.
Thanks in advance for any answers
turbomann123 is offline  
Old 01/28/2021, 03:40   #2
 
elite*gold: 0
Join Date: Oct 2018
Posts: 257
Received Thanks: 207
ncif packet is the "target" packet.
When you send it, you receive a st packet with target hp/mp and list of buffs, if i remember correctly
the packet you want to send is u_s or u_as if the skill is a skillshot, then there are some arguments.
Take a look at


for the arguments

About your character hp, just read the stat packet
(arguments here : there is also another argument, it's used for the settings such as family blocked, you don't care about it)


And for the map, Pumba used a widget on Qt and tracked the mouse click position in order to use it for a walk packet : )
Apourtartt is offline  
Thanks
1 User
Old 01/30/2021, 21:41   #3
 
elite*gold: 0
Join Date: Jan 2011
Posts: 10
Received Thanks: 1
Thank you very much for your reply. It helped me a lot. I can now save waypoints, walk along them, attack monster in my area...
My biggest problem right now is the handeling of the packets from the packet logger. I get them via TCP. I tryed to split the received packets at each blank space to analyse them. The problem is that i get a really long list and have to itarate over it to search for "mv" or "stat" to get the values. It would be way better if i only get 1 packet to analyse at a time.

Code to connect to packet logger and recv packets
Code:
def receiveData():
    return str(s.recv(1024), "cp1252")


HOST, PORT = "127.0.0.1", get_nostale_packet_logger_ports()[0]
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))

Thread which always gets the new packets.
Code:
def packetListenThread():
    global packet
    while True:
        receivedPacket = PacketSender.receiveData()
        packet = receivedPacket.split()
turbomann123 is offline  
Old 01/30/2021, 22:04   #4
 
elite*gold: 0
Join Date: Oct 2018
Posts: 257
Received Thanks: 207
This is really strange to have multiple threads for a bot, why do you have two ?
I don't know much about python, neither about the format of packets sent by bladetigger's packetlogger, but try maybe to split by newline ("\n") ?
Apourtartt is offline  
Old 01/30/2021, 22:22   #5
 
elite*gold: 0
Join Date: Jan 2011
Posts: 10
Received Thanks: 1
Thread topic:
my approach was to make multiple threads for different tasks. One is for checking the health of the player, one for walking... they are all basically while loops which run parrallel.

The biggest problem is, that i cant get the packets one by one. But i think you cant help me with this.

I cant try the newline approach right now but i will try it later

The packet splittet at each space bar:
turbomann123 is offline  
Old 01/30/2021, 23:01   #6

 
FI0w's Avatar
 
elite*gold: 50
Join Date: Jul 2014
Posts: 1,700
Received Thanks: 1,165
Quote:
Originally Posted by turbomann123 View Post
Thread topic:
my approach was to make multiple threads for different tasks. One is for checking the health of the player, one for walking... they are all basically while loops which run parrallel.

The biggest problem is, that i cant get the packets one by one. But i think you cant help me with this.

I cant try the newline approach right now but i will try it later

The packet splittet at each space bar:
Maybe you can use some Game Functions to get HP/Walk etc would be easier
FI0w is offline  
Old 01/30/2021, 23:09   #7
 
Hatz~'s Avatar
 
elite*gold: 0
Join Date: May 2020
Posts: 369
Received Thanks: 448
It seems like the first packet on your output is displaying correctly but the others are not. Are you cleaning up the variable in which you store the received data? The packetlogger should be sending the packets 1 by 1. In c++ you can use this function to clean the data from your buffer:

In c++ you should call it like this:
Hatz~ is offline  
Old 01/31/2021, 00:12   #8
 
Limoo's Avatar
 
elite*gold: 0
Join Date: Jan 2017
Posts: 475
Received Thanks: 192
I split them with vbCr
Limoo is offline  
Old 01/31/2021, 04:35   #9
 
elite*gold: 0
Join Date: Jan 2011
Posts: 10
Received Thanks: 1
Quote:
Originally Posted by FI0w View Post
Maybe you can use some Game Functions to get HP/Walk etc would be easier
I got no idea how to do that. The packet sending strategy see,s quiet promising.


Quote:
Originally Posted by Hatz~ View Post
It seems like the first packet on your output is displaying correctly but the others are not. Are you cleaning up the variable in which you store the received data? The packetlogger should be sending the packets 1 by 1. In c++ you can use this function to clean the data from your buffer:

In c++ you should call it like this:
Thank you for the idea. I rethought my tcp recieve function and with the comment of Limoo i got the solution.

with s.recv(1024) i took 1024 bytes from the packet logger which explains why i got such long lists after i splitted it. Now i take one Byte at a time and if a newline appears i save the packet and reset the variable.

Code:
def receiveData():
    global fullpacket
    packet = ""
    while True:
        part = s.recv(1).decode('utf-8')
        if part == "\r":
            fullpacket = packet.split()
            packet = ""
            print(fullpacket)
        packet += part
this is giving me a nice list whith only one packet in it.


I got a new question. What is the best way to track the current player position?
turbomann123 is offline  
Reply




All times are GMT +1. The time now is 00:59.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.