[Release] PacketLogger

04/08/2022 10:25 bledior#451
@[Only registered and activated users can see links. Click Here To Register...] unfortunately it didn't fix it. Same problems in both packet logger and in my TCP client.

I tried different encodings to make sure, like utf8, latin1 etc...
04/08/2022 13:20 BladeTiger12#452
Do you have any character I can test with? When I try characters like kanji's or cyrillic's directly in NosTale chat I just see "?" or what client language u're using?
04/08/2022 13:50 bledior#453
@[Only registered and activated users can see links. Click Here To Register...] ™ ę ś ć ó etc... I am using Polish client.
04/08/2022 14:27 BladeTiger12#454
Strange, in my example AutoIt Script these characters work: (NosTale converted the middle 3 characters to the default in german client) but the ™ and ó is working

Be careful: If you log it to your console it could also be that the console cannot print these characters.
04/08/2022 14:38 bledior#455
@[Only registered and activated users can see links. Click Here To Register...] I attached screenshot. Name of the pet should be Krzakogon^Szczęścia.
04/08/2022 14:41 bledior#456
Yeah but I am rendering these names in my Electron app (web) and they are displayed wrong too.

I will keep looking if its problem on my side.
04/08/2022 15:03 BladeTiger12#457
Quote:
Originally Posted by bledior View Post
@[Only registered and activated users can see links. Click Here To Register...] I attached screenshot. Name of the pet should be Krzakogon^Szczęścia.
The characters looks good on the PacketLogger UI?
They're wrong when you show them in your electron app?
04/08/2022 15:13 bledior#458
@[Only registered and activated users can see links. Click Here To Register...] they are wrong both in packet logger and my electron app.
04/08/2022 18:33 BladeTiger12#459
Ok but it looks like it isn't a problem with the PacketLogger. I managed it to partially show the string in node:

You need to run "npm install iconv-lite" before.
The other packages are in node. (But I think you know that :D)

HTML Code:
var net = require('net');
var fs = require('fs');
var iconv = require('iconv-lite');
iconv.skipDecodeWarning = true;

var client = new net.Socket();

client.setEncoding('binary');
client.connect(60174, '127.0.0.1', function() {
	console.log('Connected');
	client.write('Hello, server! Love, Client.');
});

client.on('data', function(data) {
    data.split('\r').forEach(packet => {
        const splittedPacket = packet.split(' ');
        if (splittedPacket.length === 1) return;

        if (splittedPacket[1][0] === '/') {
            const res = iconv.decode(data, 'ISO-8859-2');

            console.log(res);
 
            fs.writeFileSync("chat.txt", res);
        }
    });
});
/*
Krzakogon^Szczęścia ™ ę ś ć ó
*/
04/08/2022 18:49 bledior#460
@[Only registered and activated users can see links. Click Here To Register...] I hate so much encodings. I tried iconv before, yeah it fixes it partially.
@[Only registered and activated users can see links. Click Here To Register...] Finally I got it. Use iconv and decode it as Windows-1250 :D

I think 8bitlocal and Windows-1250 is solution.

At least for Polish client.
04/08/2022 19:03 BladeTiger12#461
Quote:
Originally Posted by bledior View Post
@[Only registered and activated users can see links. Click Here To Register...] I hate so much encodings. I tried iconv before, yeah it fixes it partially.
@[Only registered and activated users can see links. Click Here To Register...] Finally I got it. Use iconv and decode it as Windows-1250 :D

I think 8bitlocal and Windows-1250 is solution.

At least for Polish client.
Nice, I tried it and worked.
Then good luck with your Electron-App :)

Glad that it's fixed now.
04/08/2022 19:09 bledior#462
@[Only registered and activated users can see links. Click Here To Register...] Thanks :) And thank you for the packet logger update and your time.
04/09/2022 12:32 1luca1#463
hello, i would like to create a betting bot, but unfortunately i can't manage that all the time the packets are intercepted and every 5,5sec the item is betted. if i include a sleep(5500) the packets are only retrieved every 5,5sec. How can I get the packets to be retrieved all the time and bet every 5.5 seconds.
I used consolewrite in the code only to check if the packets are fetched every 5,5sec or all the time.
It builds on the code from the autoit example
Here my crap code :D

HTML Code:
While True
   Bet()
   EQCheck()
   PacketLogger_Handle($Socket, ProcessPackets)
 WEnd

Func ProcessPackets($Type, $PacketSplitted, $FullPacket)
   $e_info = ""
   ConsoleWrite($PacketSplitted[0] &  [MENTION=3576271]CRLF[/MENTION]@
   If $PacketSplitted[0] = "e_info" Then
	  $e_info = $FullPacket
	  ConsoleWrite($FullPacket &  [MENTION=3576271]CRLF[/MENTION]@
   EndIf
   ;If StringInStr($e_info, "1.16") or StringInStr($e_info, "1.15") Then ;Crit dmg or crit chance
   ;EndIf

EndFunc

Func Bet()
    ;PacketLogger_SendPacket($Socket,"up_gr 7 0 0") ;bet Item
	Sleep(5500)
 EndFunc

Func EQCheck()
   PacketLogger_SendPacket($Socket,"eqinfo 1 0")
EndFunc
04/09/2022 13:22 BladeTiger12#464
Quote:
Originally Posted by 1luca1 View Post
hello, i would like to create a betting bot, but unfortunately i can't manage that all the time the packets are intercepted and every 5,5sec the item is betted. if i include a sleep(5500) the packets are only retrieved every 5,5sec. How can I get the packets to be retrieved all the time and bet every 5.5 seconds.
I used consolewrite in the code only to check if the packets are fetched every 5,5sec or all the time.
It builds on the code from the autoit example
Here my crap code :D

HTML Code:
While True
   Bet()
   EQCheck()
   PacketLogger_Handle($Socket, ProcessPackets)
 WEnd

Func ProcessPackets($Type, $PacketSplitted, $FullPacket)
   $e_info = ""
   ConsoleWrite($PacketSplitted[0] &  [MENTION=3576271]CRLF[/MENTION]@
   If $PacketSplitted[0] = "e_info" Then
	  $e_info = $FullPacket
	  ConsoleWrite($FullPacket &  [MENTION=3576271]CRLF[/MENTION]@
   EndIf
   ;If StringInStr($e_info, "1.16") or StringInStr($e_info, "1.15") Then ;Crit dmg or crit chance
   ;EndIf

EndFunc

Func Bet()
    ;PacketLogger_SendPacket($Socket,"up_gr 7 0 0") ;bet Item
	Sleep(5500)
 EndFunc

Func EQCheck()
   PacketLogger_SendPacket($Socket,"eqinfo 1 0")
EndFunc
Use something like a timer that runs the function later, I think with "AdlibRegister("YourFunctionName", <Milliseconds>)"

So you could to smth. like this: (Crappier solution but easier to understand I guess)

HTML Code:
Func Bet()
    PacketLogger_SendPacket($Socket,"up_gr 7 0 0") ;bet Item
    AdlibRegister("DoSmthElseAfter5500Milliseconds", 5500) ;Start 5.5s interval
 EndFunc

Func DoSmthElseAfter5500Milliseconds()
  ; This will run after 5,5 seconds
  AdlibUnRegister("DoSmthElseAfter5500Milliseconds") ;Stop 5.5s interval, otherwise it would run this function again after 5,5 seconds
EndFunc
The better solution would be to work with a Timestamp, check in the While loop above if 5.5s passed and run the function ([Only registered and activated users can see links. Click Here To Register...]) but in this case it should be enough for you.
04/09/2022 14:46 1luca1#465
Quote:
Originally Posted by BladeTiger12 View Post
Use something like a timer that runs the function later, I think with "AdlibRegister("YourFunctionName", <Milliseconds>)"

So you could to smth. like this: (Crappier solution but easier to understand I guess)

HTML Code:
Func Bet()
    PacketLogger_SendPacket($Socket,"up_gr 7 0 0") ;bet Item
    AdlibRegister("DoSmthElseAfter5500Milliseconds", 5500) ;Start 5.5s interval
 EndFunc

Func DoSmthElseAfter5500Milliseconds()
  ; This will run after 5,5 seconds
  AdlibUnRegister("DoSmthElseAfter5500Milliseconds") ;Stop 5.5s interval, otherwise it would run this function again after 5,5 seconds
EndFunc
The better solution would be to work with a Timestamp, check in the While loop above if 5.5s passed and run the function ([Only registered and activated users can see links. Click Here To Register...]) but in this case it should be enough for you.
Ive done it with the timer and it works like a charm!! Thanks!!
Thats my code now
HTML Code:
$iMilliSec = 5500
$hTimer = TimerInit()

While True
   PacketLogger_Handle($Socket, ProcessPackets)
   If TimerDiff($hTimer) > $iMilliSec Then
        Bet()
	$hTimer = TimerInit()
	 EndIf
 WEnd