mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 2
M
Bowl of petunias
OP Offline
Bowl of petunias
M
Joined: Aug 2004
Posts: 2
'lo,
I'm having a weird issue with sockets.

I have a daemon im connecting to that returns time elapsed since a certain date, mirc ten reads the input from the daemon and prints the exact text to the screen.

I noticed mirc was reading the numbers wrong, any suggestions?
-------
SERVER REPLYS WITH: 15650343
MIRC THINKS IT SAYS: 1450582
-------
i dont know what mirc is doing to the numbers, but here's my sockread event:
on 1:sockread:ptilookup:{
if (%ptil.stop == yes) { sockclose ptilookup | halt }
if ($sockerr > 0) return
:nextread
sockread -f %temp2
if ($sockbr <= 0) { ptil.action }
if (%temp2 == $null) return
;;;;ECHO HERE FOR DEBUGGING!
echo -a Read: %temp2
;;;;END DEBUGGING
if (*Username:* iswm %temp2) { set %ptil.action user }
if (*Password* iswm %temp2) { set %ptil.action pass }
if (*Command* iswm %temp2) { set %ptil.action last }
if (*invalid*username*or*password* iswm %temp) { set %pti;.action invalid }
set %ptil.stuff %temp2
goto nextread
}

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Perhaps this isnt all the coding in the sockread, but there seems to be redunant code at any rate. A sockread can simply be:

On *:Sockread:sockname:{
sockread %var
echo Recieved: %var
}

- See what kind of figures that outputs.

Eamonn.

Joined: Aug 2004
Posts: 2
M
Bowl of petunias
OP Offline
Bowl of petunias
M
Joined: Aug 2004
Posts: 2
Ok, manually running through the login and password with /sockwrites it returns the correct values:
Recieved: Command?
Recieved: 100 15719024 1076452878

Now, when i automate the user/password/command sending, it chops up the numbers
Recieved: 100 1518801 1090652842

Any clues at all? is it something to do with the way mirc stores variables?


Link Copied to Clipboard