• Expression 2 Chip spams Chat message. How can I prevent it from doing that?
    6 replies, posted
Yes, Expression 2 is not Lua. Tbh I wasn`t sure if I should post this in Developers or in the normal Garry`s Mod Forum. I`m sure I find out soon... Context: Currently I am using Expression 2 again after several years, so I barely remember anything. I am trying to write a Expression 2 Stargate Chip for personal Projects. Right now the Chip takes as Inputs the Stargates Active, Inbound and Chevron Parameters. Which are all Numbers. In case you don`t know: Active - 0 if Stargate is offline, 1 if Stargate is doing literally anything besides being offline Inbound - 0 if Stargate is dialing to some other Gate, 1 if Stargate is being dialed by someone else Chevron - Numbers from 0 to 9, depending on how many Chevrons are currently locked in the Gate The Problem: The Chip is supposed to write Chat messages to me when the Stargate is being dialed on, or dialing out. And it is also supposed to show the locked Chevrons in chat. It is supposed to look like this: Inbound (Being dialed on by someone else): [BOT]: Attention, Stargate is being dialed. [BOT]: Chevron 1 locked. [BOT]: Chevron 2 locked. [BOT]: Chevron 3 locked. [BOT]: Chevron 4 locked. [BOT]: Chevron 5 locked. [BOT]: Chevron 6 locked. [BOT]: Chevron 7 locked. [BOT]: Chevron 8 locked. [BOT]: Chevron 9 locked. [BOT]: Chevron 10 locked. Outbound (Dialing to a other gate): [BOT]: Dialing Stargate. [BOT]: Chevron 1 locked. [BOT]: Chevron 2 locked. [BOT]: Chevron 3 locked. [BOT]: Chevron 4 locked. [BOT]: Chevron 5 locked. [BOT]: Chevron 6 locked. [BOT]: Chevron 7 locked. [BOT]: Chevron 8 locked. [BOT]: Chevron 9 locked. [BOT]: Chevron 10 locked. But what happens instead is: [BOT]: Dialing Stargate.     [BOT]: Attention, Stargate is being dialed     [BOT]: Attention, Stargate is being dialed     [BOT]: Chevron 1 locked.      [BOT]: Attention, Stargate is being dialed     [BOT]: Chevron 2 locked.      [BOT]: Attention, Stargate is being dialed     [BOT]: Chevron 3 locked.      [BOT]: Attention, Stargate is being dialed     [BOT]: Chevron 4 locked.      [BOT]: Attention, Stargate is being dialed     [BOT]: Chevron 5 locked.      [BOT]: Attention, Stargate is being dialed     [BOT]: Chevron 6 locked.      [BOT]: Attention, Stargate is being dialed     [BOT]: Chevron 7 locked.      Plus, when disconnecting the gates, as soon as they actually turned offline the Bot also decides to say this as well: [BOT]: Attention, Stargate is being dialed     [BOT]: Attention, Stargate is being dialed     This is the Chips code so far: @name KATO @inputs W:wirelink Inbound Active Chevron OutBoundGateName @outputs @persist Time runOnChat(1) if (Inbound == 1){     print("[BOT]: Attention, Stargate is being dialed" )     if (Chevron > 0){         print("[BOT]: Chevron "+Chevron+" locked. ")     } } if (Active == 1 & Inbound == 0){     print("[BOT]: Dialing Stargate.")     if (Chevron > 0){         print("[BOT]: Chevron "+Chevron+" locked. ")     } } I tried to find a previous Post at other pages and this page, no result tho. Atleast not what I need. I had this Problem years ago with another Bot I made, and also back then I never managed to fix it. So if anyone knows how to deal with that, I really appreciate it.
Make use of ~ and $ operators Expression 2 · wiremod/wire Wiki · GitHub and also remove runOnChat(1) I guess
the ~ operator helped alot there. Didnt knew about that. Removing runOnChat(1) would break my whole bot since its chat based
Oh, the Stargate E2 chips were my favorite thing to do. Glad to see I am not the only one remebering it
Several Years ago I playd on a Stargate Wars server (you basically build your base or spaceship with stargates and fight each other, or just hide. whatever you want). The server allowed wire and E2 and It was the best thing I ever had in gmod. Server is down now and no one plays that kind of stuff anymore...so me and 3 other dudes do a fight on a private game session. And I thought I re create my bot from years ago
actually, maybe you are able to help me? The more I do in E2 the more Bugs and Errors I meet. For example detecting Numbers 1/0. It always says 0, even tho it obviously is 1. Even visible through a number screen. Which basically makes me unable to create aloooot of functions/features i would like to do
There's a reddit and discord for wiremod which you can find here. The discord is more active and helpful.
Sorry, you need to Log In to post a reply to this thread.