The online racing simulator
Searching in All forums
(26 results)
1
WildGamerz
S3 licensed
Can i get like source Code if possible? or if you got time can you please make it work for the online use in the servers? like being able to set UCID for the button and admin password etc?
CONDUCT WARNING 1 ban until global 30 day ban!
WildGamerz
S3 licensed
so im getting this errors.. today
CONDUCT WARNING 1 ban until global 30 day ban!

i was making my insim and testing out the !ban and !unban commands and randomly got this errors
thought it was from my insim and nope someone said it new test patch bans me for 30 days is there any way to remove this CONDUCT WARNING 1 ban until global 30 day ban! if so please do it im just doing my test insim.
and how can i email the devs to remove it if possible my
lfs username is WildGamerz

i suppose i need to be banned from 36 servers before you ask me you can check my history if you got them im clean im mostly just !ban and !unban myself on my own servers [CS] Civic State and [CS] Civic State Dev
thats it
Last edited by WildGamerz, .
WildGamerz
S3 licensed
Hope it helps new people that are interested in it Smile the text box looks like this hope it helps
WildGamerz
S3 licensed
Alright here the program.cs press S to show the buttons and h to hide them ofc and it not even that refined but it better than nothing Smile


using System;
using System.Collections.Generic;
using System.Linq;
using InSimDotNet;
using InSimDotNet.Packets;

namespace MultiLineButton
{
public class MultiLineButton
{
private readonly InSim _inSim;
private readonly byte _clickId;
private readonly byte _ucid;
private readonly byte _width;
private readonly byte _height;
private readonly byte _top;
private readonly byte _left;
private readonly byte _rowHeight;
private readonly byte _maxCharsPerRow;
private readonly string _text;
private readonly bool _showScrollbar;
private readonly ButtonStyles _style;
private readonly List<string> _lines;
private int _scrollPosition;
private readonly byte _scrollbarWidth;
private readonly Dictionary<byte, ButtonInfo> _buttonInfo;

private struct ButtonInfo
{
public ButtonType Type { get; set; }
public string Text { get; set; }
}

private enum ButtonType
{
Background,
TextLine,
ScrollUp,
ScrollTrack,
ScrollDown
}

public MultiLineButton(
InSim inSim,
byte clickId,
byte ucid,
byte width,
byte height,
byte top,
byte left,
byte rowHeight,
byte maxCharsPerRow,
string text,
ButtonStyles style = ButtonStyles.ISB_DARK)
{
_inSim = inSim;
_clickId = clickId;
_ucid = ucid;
_width = width;
_height = height;
_top = top;
_left = left;
_rowHeight = rowHeight;
_maxCharsPerRow = maxCharsPerRow;
_text = text;
_style = style;
_scrollPosition = 0;
_scrollbarWidth = (byte)Math.Max(4, Math.Round(rowHeight * 0.75));
_buttonInfo = new Dictionary<byte, ButtonInfo>();
_lines = SplitTextIntoLines(text, maxCharsPerRow);
_showScrollbar = _lines.Count * rowHeight > height;

// Setup event handlers
_inSim.Bind<IS_BTC>((inSim, packet) => HandleButtonClick(packet));
}

public void Show()
{
DrawButtons();
LogButtonInfo();
}

public void Hide()
{
ClearButtons();
}

private void DrawButtons()
{
ClearButtons();
var textAreaWidth = (byte)(_showScrollbar ? _width - _scrollbarWidth : _width);
var maxVisibleRows = _height / _rowHeight;

// Background button
SendButton(
_clickId,
_top,
_left,
_width,
_height,
"",
_style | ButtonStyles.ISB_DARK,
ButtonType.Background
);

// Draw scrollbar if needed
if (_showScrollbar)
{
var canScrollUp = _scrollPosition > 0;
var canScrollDown = _scrollPosition + maxVisibleRows < _lines.Count;
var scrollbarLeft = (byte)(_left + textAreaWidth);

// Up arrow
if (canScrollUp)
{
SendButton(
(byte)(_clickId + 1),
_top,
scrollbarLeft,
_scrollbarWidth,
_rowHeight,
"▲",
_style | ButtonStyles.ISB_CLICK | ButtonStyles.ISB_DARK,
ButtonType.ScrollUp
);
}

// Scrollbar track
if (maxVisibleRows > 2)
{
var scrollbarHeight = (byte)(_height - (2 * _rowHeight));
var scrollbarThumbHeight = (byte)(scrollbarHeight * maxVisibleRows / Math.Max(1, _lines.Count));
var scrollbarPosition = (byte)(_top + _rowHeight +
(_scrollPosition * (scrollbarHeight - scrollbarThumbHeight) /
Math.Max(1, _lines.Count - maxVisibleRows)));

SendButton(
(byte)(_clickId + 2),
scrollbarPosition,
scrollbarLeft,
_scrollbarWidth,
scrollbarThumbHeight,
"",
_style | ButtonStyles.ISB_DARK,
ButtonType.ScrollTrack
);
}

// Down arrow
if (canScrollDown)
{
SendButton(
(byte)(_clickId + 3),
(byte)(_top + _height - _rowHeight),
scrollbarLeft,
_scrollbarWidth,
_rowHeight,
"▼",
_style | ButtonStyles.ISB_CLICK | ButtonStyles.ISB_DARK,
ButtonType.ScrollDown
);
}
}

// Draw text lines
byte currentId = (byte)(_clickId + 4);
for (var i = 0; i < maxVisibleRows && i + _scrollPosition < _lines.Count; i++)
{
var text = _lines[i + _scrollPosition];
// Add ellipsis if there's more text below
if (i == maxVisibleRows - 1 && i + _scrollPosition < _lines.Count - 1)
{
text += "...";
}

SendButton(
currentId++,
(byte)(_top + i * _rowHeight),
_left,
textAreaWidth,
_rowHeight,
text,
_style | ButtonStyles.ISB_C4,
ButtonType.TextLine
);
}
}

private void SendButton(
byte clickId,
byte top,
byte left,
byte width,
byte height,
string text,
ButtonStyles style,
ButtonType type)
{
_buttonInfo[clickId] = new ButtonInfo { Type = type, Text = text };

var button = new IS_BTN
{
ReqI = 1,
ClickID = clickId,
UCID = _ucid,
T = top,
L = left,
W = width,
H = height,
Text = text,
BStyle = style
};

_inSim.Send(button);
}

private void HandleButtonClick(IS_BTC packet)
{
if (!_buttonInfo.ContainsKey(packet.ClickID))
return;

var buttonInfo = _buttonInfo[packet.ClickID];
var maxVisibleRows = _height / _rowHeight;

switch (buttonInfo.Type)
{
case ButtonType.ScrollUp when _scrollPosition > 0:
_scrollPosition--;
DrawButtons();
break;

case ButtonType.ScrollDown when _scrollPosition + maxVisibleRows < _lines.Count:
_scrollPosition++;
DrawButtons();
break;
}
}

private void LogButtonInfo()
{
Console.WriteLine("\nButton Information:");
foreach (KeyValuePair<byte, ButtonInfo> button in _buttonInfo)
{
Console.WriteLine($"ClickID {button.Key}: Type={button.Value.Type}, Text={button.Value.Text}");
}
Console.WriteLine($"Total Buttons: {_buttonInfo.Count}");
}

private void ClearButtons()
{
foreach (var clickId in _buttonInfo.Keys.ToList())
{
var button = new IS_BFN
{
ReqI = 1,
UCID = _ucid,
ClickID = clickId,
SubT = ButtonFunction.BFN_DEL_BTN
};
_inSim.Send(button);
}
_buttonInfo.Clear();
}

private static List<string> SplitTextIntoLines(string text, int maxCharsPerLine)
{
var words = text.Split(' ');
var lines = new List<string>();
var currentLine = "";

foreach (var word in words)
{
if (currentLine.Length + word.Length + 1 <= maxCharsPerLine)
{
if (currentLine.Length > 0)
currentLine += " ";
currentLine += word;
}
else
{
if (currentLine.Length > 0)
lines.Add(currentLine);
currentLine = word;
}
}

if (currentLine.Length > 0)
lines.Add(currentLine);

return lines;
}
}

// Example usage
class Program
{
static void Main(string[] args)
{
Console.WriteLine("=== InSim Multi-line Button Test ===\n");
Console.WriteLine("This test demonstrates the InSim packet flow for multi-line buttons.\n");

var inSim = new InSim();
MultiLineButton multiLineButton = null;

try
{
inSim.Initialize(new InSimSettings
{
Host = "127.0.0.1",
Port = 29999,
Admin = "",
Prefix = '/',
Interval = 100,
Flags = InSimFlags.ISF_LOCAL
});

var testText = @"^7InSim Packets Explained:

1. ^7IS_BTN (Button) Packet:
- ^7ReqI: Request ID (1)
- ^7UCID: Connection ID
- ^7ClickID: Unique button ID
- ^7Inst: 0
- ^7BStyle: Button style flags
- ^7TypeIn: Max chars (0-240)
- ^7L,T: Position
- ^7W,H: Size
- ^7Text: Button text

2. ^7IS_BTC (Button Click):
- ^7ReqI: Copy of button ReqI
- ^7UCID: Connection that clicked
- ^7ClickID: Clicked button ID
- ^7Inst: 0
- ^7CFlags: Click flags

3. ^7IS_BFN (Button Function):
- ^7ReqI: Request ID
- ^7SubT: Delete/clear/etc
- ^7UCID: Target connection
- ^7ClickID: Target button";

multiLineButton = new MultiLineButton(
inSim: inSim,
clickId: 1,
ucid: 0,
width: 40,
height: 30,
top: 20,
left: 20,
rowHeight: 5,
maxCharsPerRow: 20,
text: testText,
style: ButtonStyles.ISB_C1
);

multiLineButton.Show();

Console.WriteLine("\nProgram is running. Press 'H' to hide the button, 'S' to show it again, or 'Q' to quit.");

while (true)
{
var key = Console.ReadKey(true);
switch (char.ToUpper(key.KeyChar))
{
case 'H':
multiLineButton.Hide();
Console.WriteLine("Button hidden");
break;
case 'S':
multiLineButton.Show();
Console.WriteLine("Button shown");
break;
case 'Q':
Console.WriteLine("Exiting...");
return;
}
}
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred: {ex.Message}");
}
finally
{
if (multiLineButton != null)
{
multiLineButton.Hide();
}

if (inSim != null)
{
inSim.Disconnect();
inSim.Dispose();
}
}
}
}
}


WildGamerz
S3 licensed
Sure Give me 5mins
WildGamerz
S3 licensed
Thanks for the Help guys i did make it now it working fine exactly like text box from the react node
WildGamerz
S3 licensed
i did think of that but thought that react node used single button to make all that
and i have a 1 more question does putting ReqI = 1 to both same buttons but with different contents can be displayed i tired it but it not working just wondering if it can work
WildGamerz
S3 licensed
https://www.lfs.net/forum/thread/106557 so i wanted to make or at least try to make the Text Box C# which i failed to do

https://github.com/simbroadcas ... -file#toggle-button-group
WildGamerz
S3 licensed
my bad i mean he online and i got his dm already so thought like that xd mb
WildGamerz
S3 licensed
Quote from kristofferandersen :What exactly are you trying to achieve? This is all really vague..

i talk in dm with you
WildGamerz
S3 licensed
Quote from sinanju :The %nl% part means put next lot of text on a new line.

On my server, I have the following as part of a table to see the top time for each car ...



The code for this could look like this ...

<?php 
openPrivButton
( "tt_car_note",$tt_left,$tt_top+142,68,4,3,$tt_time-12,16,"^3This table has to be partially laid out by hand ^8and was last updated: ^019 May 2025"%nl%^1If a driver beats the existing fastest time for a vehicle shown above, then table order may be wrong%nl%^7If a driver sets a time for a vehicle that is *NOT* on this list,"%nl%^2then I will have to manually update the table");
?>
Because I don't want a huge long line of text in my script, my actual code looks like ...
<?php 
openPrivButton
( "tt_car_note",$tt_left,$tt_top+142,68,4,3,$tt_time-12,16,"^3This table has to be partially laid out by hand ^8and was last updated: ^019 May 2025"
. "%nl%^1If a driver beats the existing fastest time for a vehicle shown above, then table order may be wrong"
. "%nl%^7If a driver sets a time for a vehicle that is *NOT* on this list,"
. "%nl%^2then I will have to manually update the table");
?>
To make it more readable in the script, I've put the new lines on seperate lines, and started each line with

. "%nl%

The full stop and quotation mark (. ") tells lapper that the current line should be added to the previous line.

Thanks for Replying does it only work in lfslapper or other libs? i tired to find source code for it i couldnt find anywhere that would be huge help if you could help me with it
MuiltLine
WildGamerz
S3 licensed
Quote from Bass-Driver :LFSLapper sourcecode/scripts do not work with any other library

hey it me again i will go straight to point how does the Muilt line button work?
openPrivButton( "test_colours",50,70,20,6,6,8,96,"^0 - black%nl%^1 - red%nl%^2 - green%nl%^3 - yellow%nl%^4 - blue%nl%^5 - violet%nl%^6 - cyan%nl%^7 - white%nl%^8 - no color");
im more interested in that any explain would be enough thanks Smile
Insim Button
WildGamerz
S3 licensed
Alright so im very noob in TCP programming and just started Insim and i have seen React-node-insim
im very impressed with the Text box mainly and im wondering if i can do it in C# if so how? any explanation would be huge help for me im just trying to make it for Fun i know i dont expect much help from people but it better than nothing Big grin
WildGamerz
S3 licensed
Quote from Flame CZE :Is there a reason you use InSim Relay to communicate with your server? If you...

oh didnt know that insim can used for connecting to hosts as well i thought it was only for local program lmao
Shrug
okay so after trying that as well i get this response


Unhandled Exception: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond Insimipiremoved
at System.Net.Sockets.TcpClient.Connect(String hostname, Int32 port)
at InSimDotNet.TcpSocket.Connect(String host, Int32 port)
at InSimDotNet.InSim.Initialize(InSimSettings settings)
at Program.Main(String[] args) in E:\INSIM FOLDERS(ALL)\Insimapplications\Insim Relay\Program.cs:line 63
WildGamerz
S3 licensed
Quote from Flame CZE :How do you test that it doesn't work? I see you're sending an IS_MTC packet...

yeah i didn't notice that i have put admin pass in IR_REL instead of IS_ISI packet so i got confused there IS_MTC packet works now thanks again
WildGamerz
S3 licensed
Quote from rane_nbg :Can you please say what you did to solve the issue? It's very valueable for others whom may have similair problem.

Sure! glad to help others so that they dont suffer Smile i think this code only works if you got insim.net lib 2.3.3 or latest one in https://github.com/alexmcbride/insimdotnet/tree/master

using System;
using InSimDotNet;
using InSimDotNet.Packets;
using InSimDotNet.Helpers;

class Program
{
static void Main(string[] args)
{
InSim insim = new InSim();

// Bind the MSO packet handler
insim.Bind<IS_MSO>(MessageMSO);
insim.Bind<IR_HOS>(HostList);

// Initialize InSim relay
insim.Initialize(new InSimSettings {
IsRelayHost = true,
});

// Send host select packet
insim.Send(new IR_HLR { ReqI = 1 });
insim.Send(new IR_SEL {
HName = "Hostname", // Host to select
Admin = "Passwprd", // Optional admin pass
Spec = String.Empty // Optional spectator pass
});
insim.Send(new IS_TINY { ReqI = 1, SubT = TinyType.TINY_NCN,});
insim.Send(new IS_MTC {UCID= 255, ReqI = 3, Msg = "This is Testing"});

Console.WriteLine("Connected to relay. Press any key to exit.");
Console.ReadKey();
}

static void HostList(InSim insim, IR_HOS hos) {
// Loop through each host connected to the server and print out some details
foreach (HInfo info in hos.Info) {
Console.WriteLine(
"{0} ({1} / {2})",
StringHelper.StripColors(info.HName),
info.Track,
info.NumConns);
}
}

// MSO message handler
static void MessageMSO(InSim insim, IS_MSO packet)
{
Console.WriteLine($"[{packet.UCID}] {packet.Msg}");
}
}

WildGamerz
S3 licensed
Quote from Flame CZE :How do you test that it doesn't work? I see you're sending an IS_MTC packet...

Thanks for all the helps guys solved it got a few questions as well the insim relay only works in 2.3.3 InsimDotNet lib from nuget
anything above that version doesnt kris did told me that to use .NET core instead of .NET framework is that true? just asking Smile

1 more thing if im connected to insim relay how can i create commands if Prefix field is ignored when Isrelayhost = true; in insimdotnet lib tho
Last edited by WildGamerz, .
WildGamerz
S3 licensed
Quote from kristofferandersen :Ah yes. You're using the wrong packet if you're trying to request a list of...

so again i tired but still couldn't do it

using System;
using InSimDotNet;
using InSimDotNet.Packets;

class Program
{
static void Main(string[] args)
{
InSim insim = new InSim();

// Bind the MSO packet handler
insim.Bind<IS_MSO>(MessageMSO);

// Initialize InSim relay
insim.Initialize(new InSimSettings {
IsRelayHost = true,
Admin = "",
Host = "isrelay.lfs.net",
Port = 47474
});

// Send host select packet
insim.Send(new IR_HLR { ReqI = 1 });
insim.Send(new IR_SEL { HName = "Hostname" });
insim.Send(new IS_MTC{UCID = 255, Msg = "This is Testing"});

Console.WriteLine("Connected to relay. Press any key to exit.");
Console.ReadKey();
}

// MSO message handler
static void MessageMSO(InSim insim, IS_MSO packet)
{
Console.WriteLine($"[{packet.UCID}] {packet.Msg}");
}
}

WildGamerz
S3 licensed
i have done exactly like you told still not results correct me if im wrong which im proby am Smile
using System;
using InSimDotNet;
using InSimDotNet.Packets;
using InSimDotNet.Helpers;

class Program {
static void Main() {
InSim insim = new InSim();

// Bind handler for HOS (host list) packet.
insim.Bind<IR_HOS>(HostList);

// Initialize connection to InSim Relay
insim.Initialize(new InSimSettings {
Host = "isrelay.lfs.net", // Relay host
Port = 47474, // Default relay port
IsRelayHost = true,
Admin = "", // Not needed for relay
IName = "HostLister" // Name of this client
});

// Request host list.
insim.Send(new IR_HLR { ReqI = 1 });

Console.WriteLine("Requesting host list from InSim Relay...");
Console.ReadLine();
}

static void HostList(InSim insim, IR_HOS hos) {
if (hos.NumHosts == 0) {
Console.WriteLine("No hosts found.");
return;
}

Console.WriteLine("Found {0} host(s):", hos.NumHosts);
foreach (HInfo info in hos.Info) {
Console.WriteLine(
"{0} ({1} / {2} connections)",
StringHelper.StripColors(info.HName),
info.Track,
info.NumConns);
}
}
}

InSim Relay request(Solved)
WildGamerz
S3 licensed
so im using lib from https://github.com/alexmcbride/insimdotnet i followed his exact code from his github wiki but i go no results.
when i run this i get no host list or it doesnt even connect to any host i tired every way possible i know
please correct me if im wrong..

using System;
using System.IO;
using InSimDotNet;
using InSimDotNet.Packets;
using InSimDotNet.Helpers;

namespace LFSInSimRelay
{
class Program
{
// File to log messages to
private static readonly string LogFile = "mso_log.txt";

static void Main(string[] args)
{
Console.WriteLine("Starting LFS InSim Relay...");

InSim insim = new InSim();

// Bind event handlers
insim.Bind<IS_NCN>(NewConnection);
insim.Bind<IS_MSO>(MessageOut); // Add MSO event handler

// Initialize InSim relay
insim.Initialize(new InSimSettings {
IsRelayHost = true
});

Console.WriteLine("InSim relay initialized.");
Console.WriteLine("Selecting host:");

// Select a host
insim.Send(new IR_SEL {
HName = "", // Host to select
Admin = "", // Optional admin pass
Spec = String.Empty // Optional spectator pass
});

Console.WriteLine("Requesting current connection list...");

// Request connection list
insim.Send(new IS_TINY {
ReqI = 1,
SubT = TinyType.TINY_NCN,
});

Console.WriteLine("Monitoring for new connections and MSO messages.");
Console.WriteLine("Press Enter to exit.");
Console.ReadLine();

// Clean up
insim.Disconnect();
}

static void NewConnection(InSim insim, IS_NCN ncn)
{
// Output name of each player connected to the host
Console.WriteLine("Player connected: {0}", StringHelper.StripColors(ncn.PName));
}

static void MessageOut(InSim insim, IS_MSO mso)
{
// Strip color codes from message
string cleanMessage = StringHelper.StripColors(mso.Msg);

// Format the message with user info when available
string logMessage;
if (mso.UCID > 0)
{
// Message from a user
logMessage = $"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] [USER:{mso.UCID}] {cleanMessage}";
}
else
{
// System message
logMessage = $"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] [SYSTEM] {cleanMessage}";
}

// Output to console
Console.WriteLine(logMessage);

// Log to file
try
{
File.AppendAllText(LogFile, logMessage + Environment.NewLine);
}
catch (Exception ex)
{
Console.WriteLine($"Error writing to log file: {ex.Message}");
}
}
}
}

TC Helper Premium for [TC] CityDriving
WildGamerz
S3 licensed
# TC Helper Premium

## Product Overview
TC Helper Premium is your ultimate racing companion, offering an enhanced experience with exclusive features designed to elevate your racing performance. Building upon our free version's foundation, Premium unlocks a comprehensive suite of advanced tools.

## Premium Features
* Advanced Lap Timer: Track your performance with precision timing,and detailed Laptime table
* Multi-Language Support: Translate language from ENG to other languages
* Cruise Driving: Maintain consistent speeds with automatic acceleration
* Radar System: Get real-time awareness of surrounding vehicles
* Smart Player Tracking: Monitor any player's position without additional requirements
* Contact Detection: Receive instant notifications for collisions and interactions
* Friend Stats Dashboard: Track up to 25 friends' racing statistics in real-time
* Trip System: Track your trip using our detailed statistics in real time
* Requestmod: save and request your fav mod anytime!!
and much more explained in dms

## Premium Benefits
* Exclusive access to all future premium features
* Priority customer support

## How to Get Started
1. Download and run TC Helper Premium
2. Enter your LFS ID when prompted
3. Save your hardware ID
4. Contact wildgamerz on Discord with your hardware ID
5. Receive your premium activation

## Pricing
* 20k TC Cash
## NO Refunds

## Support
Join our Discord community for support, updates, and racing discussions:
Discord Server: https://discord.gg/uMnGD33qZT

##Credits
Big Thanks to Whatalife for helping make this app possible


## Demo


---
TC Helper Premium - Enhance Your Racing Experience
Last edited by WildGamerz, .
WildGamerz
S3 licensed
Quote from WildGamerz :Does it work in insimdotnet? lib

SO no?
WildGamerz
S3 licensed
Keep in mind this is just a free version There is also premium version available
Features for Premium Version:
Cruisecontrol HUD(Screenshot below)
Busguide
Upgraded UI
able to monitor your friend's stats Max : 25
if you want to ignore certain name put # at the start of the name it will ignore that name

Discord ID;
WildGamerz
Last edited by WildGamerz, .
WildGamerz
S3 licensed
Does it work in insimdotnet? lib
WildGamerz
S3 licensed
Thanks!
1
FGED GREDG RDFGDR GSFDG