|
You last visited: Today at 04:32
Advertisement
Needing a little push
Discussion on Needing a little push within the SRO Coding Corner forum part of the Silkroad Online category.
09/09/2012, 10:58
|
#1
|
elite*gold: 0
Join Date: Jan 2011
Posts: 610
Received Thanks: 152
|
Needing a little push
Hei, i just got somewhat interest on making a little bot or w.e just for fun, im using vb.net and using the C# SilkroadSecurity and i can log in and all that but could someone give me a little example how to send any packet? example "sit"
i get:
Code:
[S -> C] [30BF]
8D 65 03 00
01
04
also i need a little help putting this:
Code:
Console.WriteLine("[{0}][{1:X4}][{2} bytes]{3}{4}{6}{5}{6}", If(context.Equals(local_context), "S->C", "C->S"), packet.Opcode, packet_bytes.Length, If(packet.Encrypted, "[Encrypted]", ""), If(packet.Massive, "[Massive]", ""), Utility.HexDump(packet_bytes), Environment.NewLine)
to textbox instead of console
|
|
|
09/09/2012, 16:57
|
#2
|
elite*gold: 0
Join Date: Jan 2009
Posts: 314
Received Thanks: 686
|
Code:
textbox1.Text = string.Format("[{0}][{1:X4}][{2} bytes]{3}{4}{6}{5}{6}", If(context.Equals(local_context), "S->C", "C->S"), packet.Opcode, packet_bytes.Length, If(packet.Encrypted, "[Encrypted]", ""), If(packet.Massive, "[Massive]", ""), Utility.HexDump(packet_bytes), Environment.NewLine);
|
|
|
09/10/2012, 10:21
|
#3
|
elite*gold: 0
Join Date: Jan 2010
Posts: 360
Received Thanks: 249
|
Packet tmp = new Packet(0x30BF, false)
tmp.writeuint32(world_id)
tmp.writeuint8(1)
tmp.writeuint8(4)
after that you can add the tmp packet to the buffer
|
|
|
09/10/2012, 17:59
|
#4
|
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
|
Quote:
Originally Posted by iNiperx
also i need a little help putting this:
Code:
Console.WriteLine("[{0}][{1:X4}][{2} bytes]{3}{4}{6}{5}{6}", If(context.Equals(local_context), "S->C", "C->S"), packet.Opcode, packet_bytes.Length, If(packet.Encrypted, "[Encrypted]", ""), If(packet.Massive, "[Massive]", ""), Utility.HexDump(packet_bytes), Environment.NewLine)
to textbox instead of console
|
WinForms or WPF?
|
|
|
09/12/2012, 02:03
|
#5
|
elite*gold: 0
Join Date: Jan 2011
Posts: 610
Received Thanks: 152
|
WinForm, and some guys told me to use C# instead, so should i ? or its the same ?
|
|
|
09/12/2012, 11:15
|
#6
|
elite*gold: 0
Join Date: Jan 2010
Posts: 360
Received Thanks: 249
|
well you will have to create a method in your form.cs which allows you to modify the textbox (you will have to use a methodinvoker).
then you can call this function from your thread and display the packet in the textbox.
|
|
|
09/12/2012, 16:49
|
#7
|
elite*gold: 0
Join Date: Jun 2007
Posts: 79
Received Thanks: 19
|
Code:
public delegate void dUpdateLogs(string log);
public dUpdateLogs UpdateLogs;
UpdateLogs = new dUpdateLogs(DoUpdateLogs);
void DoUpdateLogs(string log)
{
string currentTime = "[" + DateTime.Now.ToLongTimeString() + "] ";
if (logconsole.Dispatcher.CheckAccess())
{
logconsole.AppendText(currentTime + log + " \r");
logconsole.ScrollToEnd();
}
else
{
// Invokation required
logconsole.Dispatcher.Invoke(DispatcherPriority.Normal, new dUpdateLogs(DoUpdateLogs), log);
}
}
I used this in my old projects maybe it can help you.
|
|
|
09/15/2012, 03:51
|
#8
|
elite*gold: 166
Join Date: Apr 2009
Posts: 2,341
Received Thanks: 2,661
|
Screw all the **** invoking methods, just use this:
Code:
Add to form_load:
Control.CheckForIllegalCrossThreadCalls = False
Me.CheckForIllegalCrossThreadCalls = False
Declare your form1 to use outside:
Code:
Public Shared GUI As New Form1
To change your gui from another thread, use it like this:
Code:
Main.GUI.TextBox1.Text = "aaaaaaa"
|
|
|
09/15/2012, 06:59
|
#9
|
elite*gold: 0
Join Date: Apr 2009
Posts: 120
Received Thanks: 17
|
Code:
private void WriteLog(string text)
{
if (logbox.InvokeRequired)
{
logbox.Invoke(new MethodInvoker(() => logbox.Items.Add("[" + DateTime.Now.ToLongTimeString() + "] " + text)));
logbox.Invoke(new MethodInvoker(() => logbox.TopIndex = logbox.Items.Count - 1));
}
else
{
logbox.Items.Add("[" + DateTime.Now.ToLongTimeString() + "] " + text);
logbox.TopIndex = logbox.Items.Count - 1;
}
}
|
|
|
09/15/2012, 08:12
|
#10
|
elite*gold: 0
Join Date: Jan 2011
Posts: 610
Received Thanks: 152
|
Thx guys i got it 
Soon i'll try to send packets
|
|
|
 |
Similar Threads
|
Needing [DEV]
11/16/2012 - Shaiya Private Server - 2 Replies
Hi guys,
I am finding a developer can secure & set up shaiya server and know a little bit about the design. we can talk more on the private message ..
Thank you
|
[]Needing Help[]
01/23/2011 - Conquer Online 2 - 0 Replies
Aye i need a little help i was using " Mystic Thumbs dds Viewer " and it randomly stopped showing the .dds files im running a 64 bit comp and im needing to find a compatible DDs viewer for it..
Any suggestions?
|
Needing Help
10/10/2010 - Soldier Front Philippines - 4 Replies
Hi,
I'd just like to seek help,
My SF was working well before, but then when i accidentally downloaded the fake client patch a week ago (which contains ardamax) i have observed that my gameplay has been unstable.
I am using Avast anti virus, and when i discovered that i had downloaded a fake file patch, i immediately scanned my computer, then boot-scan it.
Then after i was able to play again.
|
Needing help :)
01/26/2009 - Dekaron - 3 Replies
Well i recently downloaded dekaron a chinese server it was at 5500x working perfect now strange thing is when i load my explorer webpage im curious yu see at the top alot of chinese words riteing saying dk 333 or something i would just like to know how to remove this from the top of my webpage its not on firefox just explorer ....
thanks for reading xx
:o:o
http://i39.tinypic.com/35a95jq.png
xxxxxxxx <3
|
All times are GMT +1. The time now is 04:32.
|
|