The online racing simulator
BTT Packet Help
I know Beaver08 made a thread on BTT Packets and i did look at it but it didn't say how to even get a box up their and i would love to know how to!

I am using LFS_External as a base and so was Beaver08.

Thanks

stuntguy
Send normal button packet but in TypeIn set max length for text to enter

BTT is for receiving info about text typed by users.
Quote from misiek08 :Send normal button packet but in TypeIn set max length for text to enter

BTT is for receiving info about text typed by users.

what?????
Quote from stuntguy3000 :what?????

Send a IS_BTN packet with the member `TypeIn` set to the max length of the string you wish to receive. The max len you can set TypeIn to is 96, the smallest value (That would make sense) is 1. The value of the IS_BTN packet will be sent back in the IS_BTT's `Text` member.
Quote from Dygear :Send a IS_BTN packet with the member `TypeIn` set to the max length of the string you wish to receive. The max len you can set TypeIn to is 96, the smallest value (That would make sense) is 1. The value of the IS_BTN packet will be sent back in the IS_BTT's `Text` member.

Sorry but that doesn't help me at all (i am confused heaps)
From InSim.txt
ISP_BTT, // 47 - info : sent after typing into a button

As you can see, IS_BTT is an info packet, which means it is always coming from LFS and never sent to it. LFS will send this packet when someone confirms (via "Ok") their input into a custom dialog window. This dialog is created by sending an IS_BTN with TypeIn set:
// TypeIn byte : if set, the user can click this button to type in text.

// Lowest 7 bits are the maximum number of characters to type in (0 to 95)
// Highest bit (128) can be set to initialise dialog with the button's text

// On clicking the button, a text entry dialog will be opened, allowing the specified number of
// characters to be typed in. The caption on the text entry dialog is optionally customisable using
// Text in the IS_BTN packet. If the first character of IS_BTN's Text field is zero, LFS will read
// the caption up to the second zero. The visible button text then follows that second zero.

// Text : 0-65-66-0 would display button text "AB" and no caption

// Text : 0-65-66-67-0-68-69-70-71-0-0-0 would display button text "DEFG" and caption "ABC"

Note that to actually see the dialog, users have to click the button.
We show you everything. If u can't understand it, go and play football outside.
Still Confused. Would it be possible for someone to post the code for it?
-
(MariusMM) DELETED by MariusMM : History
Quote from MariusMM :Well just something really really quick to show you the basics;

Add this to your MSO handler:

case "!test":
try
{
InSim.Send_BTN_CreateButton("^3Click here to open the chatbox thingy ^8", "Type whatever you want", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 30, 144, 4, 120, 120, MSO.UCID, 40, false);
}
catch
{
InSim.Send_MTC_MessageToConnection("^1Error.", MSO.UCID, 0);
}
break;

And this to your BTT handler:


if (BTT.ClickID == 120)
{
InSim.Send_MTC_MessageToConnection("" + BTT.Text, Connections[GetConnIdx(BTT.UCID)].UniqueID, 0);
}

When that is done, fire up the application, type !test in game, click the button that opens and type something, click OK and something magical will happen resent:

Thx alot
Shame on you misiek08, Dygear and morpha.. You are all supposed to be good programmers and couldn't decode his original question in the 1st place. It clearly says "Please. I can't code at all. But anyway, find a way to teach me how to do this.".

And after the 1st "what???????" you should have understood that he 1st: doesn't even know what insim.txt is(or has never opened it for more than 10 seconds, because it's not in english ); and 2: has no idea what packets are(and, yes, that does mean that he doesn't know how the internet functions :razz.

So, shame on you!!!!!!

:insane: I just love this smilie.

FGED GREDG RDFGDR GSFDG