The online racing simulator
For the buttons, where you have '+', the operator is indeed '|'. Normally it is '+' (plus), '||' (or) or '&&' (and). I'm not too sure how you receive the text entered into a textbox, but it should be in "LFS/docs/insim.txt" anyway...
The + will work, since it has (in that case) the same result as a bitwise OR. The correct way would be using ISB_DARK Or ISB_CLICK, though.
My code run fine, but I use C#, you only need put the ID and the action what you want.
Ok, I try to explain more precisely:

A Click-Button works fine:


InSim.Send_BTN_CreateButton("OK",Flags.ButtonStyles.ISB_CLICK + Flags.ButtonStyles.ISB_DARK, 5, 40, 70, 40, 103, NCN.UCID, 103, False)

even with Or instead of + this is still working

InSim.Send_BTN_CreateButton("OK",Flags.ButtonStyles.ISB_CLICK Or Flags.ButtonStyles.ISB_DARK, 5, 40, 70, 40, 103, NCN.UCID, 103, False)

even the other way (more parameters) is fully functional

InSim.Send_BTN_CreateButton("OK","Here should be the Dialog-Text",Flags.ButtonStyles.ISB_CLICK Or Flags.ButtonStyles.ISB_DARK, 5, 40, 70, 40, 0, 103, NCN.UCID, 103, False)

The way to tell a Click-Button to be a Dialog-Button is to give it a value greater then zero for TypeIn. You may have a look into the LFS External Documentation (InSimInterface.Send_BTN_CreateButton Method).
So I did provide a value like 20, 30, 95, 127, 255 with only one result: The Button isn't visible anymore.

I'm not sure but it could be that Dialog-Buttons won't work on server-based InSim-Applications, only in client-based ones.

*** Ahhh, I had a look to the Dedi-Server and saw a message: Dialog-Button cannot always be visible. I changed the last parameter (AlwaysVisible) from true to false, and now it works as expected!

Thanks for your help anyway!
I am testing in Debian, LFS crashed and I don't know what is the problem, I am using Debian, Mono 1.9 for .net and Wine.
Have some crash, 1º problems with System (Mayority of System.IO, I use for define the patch @"users" for create a folder in the same route where I execute the aplication.) and LFS external, the screenshots are in different time, when I fixed one problem apeear other.
Send_TINY
Hi all.
I will send an TINY(InSim.Send_TINY(Enums.Tiny.TINY_VTC,0) ), but when i write InSim.Send_TINY, i dont find the method??

Im using LFS_External 1.1.1.0;
Can someone help me to send an TINY Packet

thx
When sending out packets through InSim, you don't need to send them from a particular method. To send a TINY_VTC, it would be something like this:

InSim.Send_TINY(Enums.Tiny.TINY_VTC, 255);

When a vote is cancelled successfully, LFS sends back a TINY_VTC packet.

// When a vote is cancelled, LFS sends this IS_TINY

// ReqI : 0
// SubT : TINY_VTC (VoTe Cancelled)

Hope that helps
Yes, that is what i would do and thats wright what y writing, but i have the problem that the Send_TINY is not in my package, grazy ?????

Here is a Screenshot of my InSimInterface Sendmethods. No Send_TINY
Attached images
insiminterface.JPG
Quote from bapaf :Yes, that is what i would do and thats wright what y writing, but i have the problem that the Send_TINY is not in my package, grazy ?????

Here is a Screenshot of my InSimInterface Sendmethods. No Send_TINY

Ah, I see what you mean now It isn't there in v1.1.0.0 for some reason...unless I just can't see it...my example was from the previous version though...
I hope T-Ronx fix the problem.
Great work
Here is an experimental Compact Framework compatible build. There is a slight issue, since Win CE is fully unicoded and does not support Ansi marshaling the only way to put single byte char strings in the packets is with a byte array. So you have to convert the strings manually. In upcoming versions I will make a layer between the packet and receive event so I can solve this issue nicely.

Oh and don't worry about the new namespace, thats for the upcoming release.

Would be nice if anyone could have a test.

Thanks,
Ron
Attached files
lfs_external_insim_csf11_cf.zip - 92.1 KB - 517 views
If you hold Ctrl+T for a minute it disconnects the insim from the server. Can you fix this?
im getting a build error and i havent changed any code .... "
Handles clause requires a WithEvents variable defined in the containing type or one of its base types"

I havent even touched the coding, whats wrong? I am noob at Visual Basic , So please bear with me....
It's Visual C#
So it is :eek:

Never even noticed that, nice work
What download is the source included in?
Quote from elmohellno :What download is the source included in?

None yet. There are some things I need to take care of first. If thats done, I'll make the source available for download.
t-ronx, when I try using your lib for outgauge on compact Framework(didnt use it for insim yet), it gives run-time error of "cannot load System with this version of....."

You didnt update outgauge for CF, did ya?

Im trying to code a gauge for windows mobile 5 - should be a big hit.
Another way, of course, is simply code my own listener, but my m4d sk1lzzz dont quite strech that far yet. (maybe after exams Ill go dig up my Computer Networks notes, and go and code a TCP listener myself).
Yes, I only updated InSim so far. OutGauge and OutSim will be updated in the final version too.
kk, thxsw for the fast reply. Now to find out some interesting app to do using insim and a PDA...
Maybe lapper-ish thing together with my pitboard...

thingsToDo.add(new Project(LFS_External, PDA, new Project()));
wifeHappiness --;

Hey T-RonX,

I'm coding like 2 days now in VB with your LFS External and I get it bit by bit...
My knowledge of VB is good, but not excellent ^^ Forgive me for the crappy code =$

I'm trying to make a visual admin panel but I have this error:
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

In this piece of code:
Me.Invoke(New dlgMSO(AddressOf MSO_MessageOut), p)

The total code is listed here:
Private Sub MSO_MessageOut(ByVal MSO As Packets.IS_MSO)
'Invoke method due to threading. Add this line to any receive event before updating the GUI. Just like in this example, you only have to add a new delegate with the right packet parameter and adjust this line in the new method.
If DoInvoke() Then
Dim p As Object = MSO
Me.Invoke(New dlgMSO(AddressOf MSO_MessageOut), p)
Return
End If

'tekst.Replace(Connections(GetConnIdx(MSO.UCID)).PlayerName, "").Replace("^0", "").Replace("^1", "").Replace("^2", "").Replace("^3", "").Replace("^4", "").Replace("^5", "").Replace("^6", "").Replace("^7", "").Replace("^8", "")

Dim tekst As String = MSO.Msg.Substring(MSO.TextStart, (MSO.Msg.Length - MSO.TextStart))
Dim msg() As String = tekst.Split()
Select Case msg(0)
Case "!online"
InSim.Send_BTN_CreateButton("Players: " & CStr(Players.Count), Flags.ButtonStyles.ISB_CLICK Or Flags.ButtonStyles.ISB_DARK, 5, 30, 10, 20, 99, MSO.UCID, 99, True)

Case "!connections"
InSim.Send_BTN_CreateButton("Connecties: " & CStr(Connections.Count), Flags.ButtonStyles.ISB_CLICK Or Flags.ButtonStyles.ISB_DARK, 5, 30, 15, 20, 98, MSO.UCID, 98, True)

Case "!userlist"

Dim i As Integer = 1
Dim k As Integer = 0

'InSim.Send_BTN_CreateButton("Exit", Flags.ButtonStyles.ISB_CLICK Or Flags.ButtonStyles.ISB_DARK, 10, 20, 30, 10, 97, MSO.UCID, 97, True)

For i = 1 To Connections.Count
k = 0
InSim.Send_BTN_CreateButton(Connections(i).PlayerName, Flags.ButtonStyles.ISB_CLICK Or Flags.ButtonStyles.ISB_DARK, 5, 20, i * 5 + 20 + 5, 20, i, MSO.UCID, i, True)
k = CInt(CStr(i) + "1")
InSim.Send_BTN_CreateButton("Kick", Flags.ButtonStyles.ISB_CLICK Or Flags.ButtonStyles.ISB_DARK, 5, 20, i * 5 + 25, 40, k, MSO.UCID, k, True)
k = CInt(CStr(i) + "2")
InSim.Send_BTN_CreateButton("Ban 1 day", Flags.ButtonStyles.ISB_CLICK Or Flags.ButtonStyles.ISB_DARK, 5, 20, i * 5 + 25, 60, k, MSO.UCID, k, True)
k = CInt(CStr(i) + "3")
InSim.Send_BTN_CreateButton("Ban 7 days", Flags.ButtonStyles.ISB_CLICK Or Flags.ButtonStyles.ISB_DARK, 5, 20, i * 5 + 25, 80, k, MSO.UCID, k, True)
k = CInt(CStr(i) + "4")
InSim.Send_BTN_CreateButton("Ban forever", Flags.ButtonStyles.ISB_CLICK Or Flags.ButtonStyles.ISB_DARK, 5, 20, i * 5 + 25, 100, k, MSO.UCID, k, True)
Next i


End Select

TextBox1.Text += tekst & Constants.vbCrLf
End Sub

When I put my For i = connection.count... loop in comment, I don't get an error...

UPDATE:

Tested a bit further and I get the error when I try this: Connections(i).PlayerName
This command in the loop should get all the PlayerNames of al the people who are connected with the server... Do I do this wrong or is there another way?
Try this:
For i = 1 To (Connections.Count - 1)
...
Next i
Yup, that works

Thanks!
Sorry for asking but I have 2 questions / requests:

1. When making an admin panel with 9 buttons like Restart, end, close, ... and for each player it's name and 9 options like kick, ban 1 day, ban 7 days, ... and all the penalties, I ran out of RequestID's because my number of ID's is bigger than 255 which is the maximum size of a byte. Is it possible to change the Request ID and the Click ID to a short?
2. Is it possible to clear all the buttons on the screen with one command?

Thanks in regards,
Silox.

FGED GREDG RDFGDR GSFDG