module-development

textPage 9 of 43
50 messages on this page
Wednesday, July 16, 2025
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Docs show main branch, not the tagged stuff. So technically, yes it is documented already haha
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Oh yeah that's right haha, it's on the main branch but not actually tagged
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Altho pretty much nothing in the documentation actually says what it does lol
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
That parameter is undocumented in current release 🙈 Next release adds it to the api spec, so you'll actually see what's possible to be extended
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
O interesting ok ty
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
You need to pass the
extend
parameter for that to be populated
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Is
PlayerOutputDTO.playerOnGameServers
supposed to return an array of pogs for corresponding pogs across all game servers? It seems to be currently returning null even for online players.
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Roger! I've noted this stuff down. It's very likely to be added/fixed in the next release but no promises 🙏
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Thanks though, it's working with adjusting to use only gameserverid and then filtering myself
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
I have to admit, it causes a twitch of pain every time I have to make a separate API call to get name from a pog lol 🙂 ❤️
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
POGs dont have a name property still, that's in the player object
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Oh bad error! You can't pass a
name
to the search like that. It should be throwing a validation error and not a 500 though :'(
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Uhhh ok why is this failing? Is /gameserver/player/search broken?
    "result": {
      "logs": [
        {
          "msg": "➡️ POST /gameserver/player/search",
          "details": {
            "args": [
              {
                "method": "post",
                "url": "/gameserver/player/search",
                "body": {
                  "search": {
                    "name": [
                      "shade"
                    ],
                    "gameServerId": [
                      "6464a337-9bca-4bb6-abe3-a38805c5a803"
                    ]
                  }
                }
              }
            ]
          }
        },
        {
          "msg": "☠️ Request errored",
          "details": {
            "args": [
              {
                "traceId": "1a64b073f212bd357b7859269db30029",
                "details": "{\"error\":{\"code\":\"InternalServerError\",\"message\":\"Internal server error\"}}",
                "status": 500,
                "statusText": "Internal Server Error",
                "method": "post",
                "url": "/gameserver/player/search",
                "response": {
                  "meta": {
                    "error": {
                      "code": "InternalServerError",
                      "message": "Internal server error"
                    }
                  },
                  "data": {}
                }
              }
            ]
          }
        },
        {
          "msg": "Request failed with status code 500",
          "details": "AxiosError: Request failed with status code 500\n    at settle (file:///opt/node_modules/axios/lib/core/settle.js:19:12)\n    at IncomingMessage.handleStreamEnd (file:///opt/node_modules/axios/lib/adapters/http.js:599:11)\n    at IncomingMessage.emit (node:events:529:35)\n    at endReadableNT (node:internal/streams/readable:1400:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\n    at Axios.request (file:///opt/node_modules/axios/lib/core/Axios.js:45:41)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async main (vm:module(0):14:25)\n    at async vm:module(0):37:1"
        }
      ],
      "success": false
    }```
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Aw still no pog.name? :/
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Add packages without having to break them up one function at a time, like a bulk file importer.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
I'm not a smart coder, but I know Takaro very well, what are you wanting to accomplish?
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
I don't suppose there's a way at this time to add dependencies to a Takaro script? 🙂
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
I think that'd be easy enough to add. I can give it a shot
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Works great for my needs thanks. Just think it could auto remove itself when it runs.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Yeah that's the one I made
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
El limon released an installed module cloner already.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
I already have this is a rudimentary way. It'll clone a server. Only draw back is every item has its own uuid per a server so those all need to be done manually.
Tuesday, July 15, 2025
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
That and the module cloner could also uninstall themselves after the cronjob runs
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
@User 53442821 I'm thinking of a module that could install a module on all servers that are enabled. Maybe pick from a drop down the kind of game you want it installed (Rust X 7 days X...). Maybe with a field to inform server ids where you do not want the module.
Basically, a mass installer for new modules, with the standard configs
Avatar for 69dd72e9beda7be7af827395b1f4c2eae3591be65684955a7d6af40731acc13c
User 69dd72
i got your triviatime with api working but still need to post it!
Avatar for 69dd72e9beda7be7af827395b1f4c2eae3591be65684955a7d6af40731acc13c
User 69dd72
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Hey all, life got busy in the last 30 days or so, what did I miss?
@User 53442821 do you still take orders for new modules? 🙂
Monday, July 14, 2025
Avatar for 69dd72e9beda7be7af827395b1f4c2eae3591be65684955a7d6af40731acc13c
User 69dd72
config schema:
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "exchangeMessage": {
      "title": "Exchange Message",
      "type": "string",
      "description": "Message sent when players deposit casino coins",
      "default": "[Exchange] You have deposited {amount} casino coins."
    },
    "accessMessage": {
      "title": "Access Message", 
      "type": "string",
      "description": "Message sent when accessing the casino",
      "default": "Casino interface accessed. Please deposit your casino coins."
    }
  },
  "required": [],
  "additionalProperties": false
}
Avatar for 69dd72e9beda7be7af827395b1f4c2eae3591be65684955a7d6af40731acc13c
User 69dd72
hook
import { takaro, data } from '@takaro/helpers';

async function main() {
  const { player, gameServerId } = data;
  const logLine = data.eventData.msg;
  
  // Check if log line contains casino coin deposit
  const coinRegex = /item=casinoCoin, qnty=(\d+)/;
  const playerRegex = /(\d{17})/; // Steam ID pattern
  
  const coinMatch = logLine.match(coinRegex);
  const playerMatch = logLine.match(playerRegex);
  
  if (coinMatch && playerMatch) {
    const quantity = parseInt(coinMatch[1]);
    const steamId = playerMatch[1];
    
    // Find the player by Steam ID
    const playerRes = await takaro.player.playerControllerSearch({
      filters: {
        steamId: [steamId]
      }
    });
    
    if (playerRes.data.data.length > 0) {
      const playerId = playerRes.data.data[0].id;
      
      // Add currency to player
      await takaro.playerOnGameserver.playerOnGameServerControllerAddCurrency(
        gameServerId, 
        playerId, 
        { currency: quantity }
      );
      
      // Send confirmation message
      await takaro.gameserver.gameServerControllerSendMessage(gameServerId, {
        message: `[Exchange] You have deposited ${quantity} casino coins.`,
        opts: {
          recipient: {
            steamId: steamId
          }
        }
      });
    }
  }
}

await main();
Avatar for 69dd72e9beda7be7af827395b1f4c2eae3591be65684955a7d6af40731acc13c
User 69dd72
if u testi t maybe it works xD
import { takaro, data } from '@takaro/helpers';

async function main() {
  const { player, gameServerId } = data;
  
  // Close any open UIs and remove items (equivalent to your CSMM command)
  await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, {
    command: `xui close looting`
  });
  
  await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, {
    command: `remitem Steam_${player.steamId}`
  });
  
  await player.pm('Casino interface accessed. Please deposit your casino coins.');
}

await main();
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Select the log line with a regex, then parse out the variablesi nside the hook code
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Should totally work with Takaro aswell, I see no reason why it wouldnt be possible
Avatar for 2bffa0f5cab2a92d04b2e63aae81661c79638a7959c6e2f44f576d976e0aa78a
User 2bffa0
In CSMM I guess yes
Avatar for 5c75f2ead9539cedf84becdac7befc72fa3bc877c1541fb168d92420c32b6730
User 5c75f2
does this still work?
Avatar for 2bffa0f5cab2a92d04b2e63aae81661c79638a7959c6e2f44f576d976e0aa78a
User 2bffa0
This is how I had it in CSMM, if you find out how to do it in Takaro, please share the module.
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Yes! That was it :D
Avatar for 2bffa0f5cab2a92d04b2e63aae81661c79638a7959c6e2f44f576d976e0aa78a
User 2bffa0

🔸INGAME COMMANDS🔸
./banco
eoc Steam_${player.steamId} "xui close looting";remitem Steam_${player.steamId}

🔸CUSTOM HOOKS🔸
Event: logLine
Search String: , item=casinoCoin, qnty=
addCurrency(${player.id}, ${custom.qnt}); pm2 [Exchange] Steam_${player.steamId} "You have deposited ${custom.qnt} casino coins."

Variables:
Name = qnt | Regex = (?<=item=casinoCoin, qnty=)(\d+)
Name = receiver | Regex= \d{17}
Avatar for 2bffa0f5cab2a92d04b2e63aae81661c79638a7959c6e2f44f576d976e0aa78a
User 2bffa0
@User 22055452 @User 48363098 you are talking about this
Avatar for 5c75f2ead9539cedf84becdac7befc72fa3bc877c1541fb168d92420c32b6730
User 5c75f2
my deposit command is working, just need to some how get the coins removed from player inventory 🤣
guessing ima need to disable the shop for now xD
Avatar for 5c75f2ead9539cedf84becdac7befc72fa3bc877c1541fb168d92420c32b6730
User 5c75f2
exactly that
Avatar for 5c75f2ead9539cedf84becdac7befc72fa3bc877c1541fb168d92420c32b6730
User 5c75f2
ive been hunting for that
Avatar for 5c75f2ead9539cedf84becdac7befc72fa3bc877c1541fb168d92420c32b6730
User 5c75f2
THAT WAS IT
Avatar for 5c75f2ead9539cedf84becdac7befc72fa3bc877c1541fb168d92420c32b6730
User 5c75f2
just not removing
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Ah I know there was something like that in CPM where you stand ontop of a chest and it takes the items from that chest. I don't remember what the commands was tohugh x.x
Avatar for 5c75f2ead9539cedf84becdac7befc72fa3bc877c1541fb168d92420c32b6730
User 5c75f2
yes that worked for inventory
Avatar for 5c75f2ead9539cedf84becdac7befc72fa3bc877c1541fb168d92420c32b6730
User 5c75f2
thank you
Avatar for 5c75f2ead9539cedf84becdac7befc72fa3bc877c1541fb168d92420c32b6730
User 5c75f2
damn it, shops useless to me unless i can make people be able to deposit their ingame money to the online shop 🤣
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Viewing inventory is no problem, taking something out of an inventory is a different story. You'll need to find an ingame command that can do that, takaro can't do it natively