File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -28,13 +28,25 @@ public string GetItemSlotAddress(int slot)
28
28
return "0x" + ( ItemSlotBase + ( ( Clamp ( slot , 1 , 20 ) - 1 ) * 0x8 ) ) . ToString ( "X" ) ;
29
29
}
30
30
31
+ public string GetItemCountAddress ( int slot )
32
+ {
33
+
34
+ return "0x" + ( ( ItemSlotBase + ( ( Clamp ( slot , 1 , 20 ) - 1 ) * 0x8 ) + 0x4 ) ) . ToString ( "X" ) ;
35
+ }
36
+
31
37
public bool SpawnItem ( Socket socket , int slot , String value , int amount )
32
38
{
33
39
try
34
40
{
35
41
byte [ ] msg = Encoding . UTF8 . GetBytes ( "poke " + GetItemSlotAddress ( slot ) + " " + FormatItemId ( value ) + "\r \n " ) ;
36
- Debug . Print ( "poke " + GetItemSlotAddress ( slot ) + " " + FormatItemId ( value ) ) ;
37
42
socket . Send ( msg ) ;
43
+
44
+ if ( amount > 1 )
45
+ {
46
+ var itemCount = GetItemCountAddress ( slot ) ;
47
+ byte [ ] countMsg = Encoding . UTF8 . GetBytes ( "poke " + itemCount + " " + ( amount - 1 ) . ToString ( "X" ) + "\r \n " ) ;
48
+ socket . Send ( countMsg ) ;
49
+ }
38
50
}
39
51
catch
40
52
{
You can’t perform that action at this time.
0 commit comments