WillSay said:supahdupahnubah said:Show whatcha got so far
Just open file ini and read , if have newline then add to chat...
supahdupahnubah said:WillSay said:supahdupahnubah said:Show whatcha got so far
Just open file ini and read , if have newline then add to chat...
Show us the code, the code that you got so far, otherwise no one will spoonfeed you
0BE3: raknet setup_incoming_rpc_hook @chat
:test
wait 0
if
31@ == 1
then
31@ = 0
chatmsg "newlineonchat" -1
end
jump @First
:chat
0BE5: raknet 29@ = get_hook_param PARAM_PACKETID
if 29@ == RPC_ScrClientMessage
if and
26@ = File.Open("cleo\test.txt", 114)
24@ = File.Size(26@)
File.ReadString(26@, 25@, 24@)
24@ += 1
then
31@ = 1
end
0BE0: raknet hook_ret true
File.Open("cleo\test.txt", "at+")
springfield said:I don't understand anything, you can use 0AAB to check if a file exists, alternatively you can pass 'at+' flag to file open, to append text to the file, and create the file if it doesn't exists already.
Code:File.Open("cleo\test.txt", "at+")
WillSay said:Code:0BE3: raknet setup_incoming_rpc_hook @chat :test wait 0 if 31@ == 1 then 31@ = 0 chatmsg "newlineonchat" -1 end jump @First :chat 0BE5: raknet 29@ = get_hook_param PARAM_PACKETID if 29@ == RPC_ScrClientMessage if and 26@ = File.Open("cleo\test.txt", 114) 24@ = File.Size(26@) File.ReadString(26@, 25@, 24@) 24@ += 1 then 31@ = 1 end 0BE0: raknet hook_ret true
Here , i dont know about check file ,
springfield said:It's not a good idea to open the file and read from it everytime you get a chat message.
So, first thing first, open the file once, read the last line once, then in the message hook, compare the new line with the old line, if they don't match, write the new line to file(open the file with append), and update the variable that holds the last message string.
You can loop with 0AD6/0AD7 to get the last string in the file.