Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. ScriptAPI
  3. how to change settings of modules via chat which are made using scripts

how to change settings of modules via chat which are made using scripts

Scheduled Pinned Locked Moved Solved ScriptAPI
19 Posts 6 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • The_Shadow_EmpT The_Shadow_Emp

    @somedudeyouveneverheardof moduleManager.getModule("Spammer").getValue("Message").set(your message) pretty sure something like that

    kaduvertK Offline
    kaduvertK Offline
    kaduvert
    wrote on last edited by
    #7
    moduleManager.getModule("Spammer").getValue('message').set('123')
    Chat.print(moduleManager.getModule("Spammer").getValue('message').get()) // prints "123"
    

    yeah, this works, but if swapping this out with a script-created module it doesn't work anymore

    1 Reply Last reply
    1
    • The_Shadow_EmpT The_Shadow_Emp

      @somedudeyouveneverheardof moduleManager.getModule("Spammer").getValue("Message").set(your message) pretty sure something like that

      FaaatPotatoF Offline
      FaaatPotatoF Offline
      FaaatPotato
      wrote on last edited by
      #8

      @the_shadow_emp ye i guess

      var Spammer = moduleManager.getModule("Spammer");
      
      moduleManager.getModule("Spammer").getValue("Message").set(module.settings.text.get())
      

      not sure if he wants to use the setting in the module but yeah

      kaduvertK 1 Reply Last reply
      0
      • FaaatPotatoF FaaatPotato

        @the_shadow_emp ye i guess

        var Spammer = moduleManager.getModule("Spammer");
        
        moduleManager.getModule("Spammer").getValue("Message").set(module.settings.text.get())
        

        not sure if he wants to use the setting in the module but yeah

        kaduvertK Offline
        kaduvertK Offline
        kaduvert
        wrote on last edited by
        #9

        @faaatpotato i want to set the setting of a script-created module via a chat command, like this: ".examplemodule text asd"

        this works fine with native modules but doesn't with script-created ones and i wonder how to fix this or another way to change a string setting ingame

        ? FaaatPotatoF 3 Replies Last reply
        0
        • kaduvertK kaduvert

          @faaatpotato i want to set the setting of a script-created module via a chat command, like this: ".examplemodule text asd"

          this works fine with native modules but doesn't with script-created ones and i wonder how to fix this or another way to change a string setting ingame

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #10
          This post is deleted!
          1 Reply Last reply
          0
          • kaduvertK kaduvert

            @faaatpotato i want to set the setting of a script-created module via a chat command, like this: ".examplemodule text asd"

            this works fine with native modules but doesn't with script-created ones and i wonder how to fix this or another way to change a string setting ingame

            FaaatPotatoF Offline
            FaaatPotatoF Offline
            FaaatPotato
            wrote on last edited by FaaatPotato
            #11

            @somedudeyouveneverheardof still not sure what u want but this script changes the spammer message if you type ingame

            .ssssd text (message you want)
            
            /// api_version=2
            var script = registerScript({
                name: "ss",
                version: "1.0",
                authors: ["No Author ok"]
            });
            
            var Spammer = moduleManager.getModule("Spammer");
            
            script.registerModule({
                name: "ssssd",
                description: "Nutting in cats is illegal",
                category: "Fun",
                tag: "s",
                settings: {
                    text: Setting.text({
                        name: "text",
                        default: ""
                    }),
                }
            
            }, function (module) {
                module.on("enable", function () {
            
                });
                module.on("disable", function () {
            
                });
                module.on("update", function () {
                	moduleManager.getModule("Spammer").getValue("Message").set(module.settings.text.get())
                });
            });
            
            kaduvertK 1 Reply Last reply
            0
            • kaduvertK kaduvert

              @faaatpotato i want to set the setting of a script-created module via a chat command, like this: ".examplemodule text asd"

              this works fine with native modules but doesn't with script-created ones and i wonder how to fix this or another way to change a string setting ingame

              ? Offline
              ? Offline
              A Former User
              wrote on last edited by A Former User
              #12

              @somedudeyouveneverheardof well it is probably a script issue, the setting changer works with other scripts

              1 Reply Last reply
              0
              • FaaatPotatoF FaaatPotato

                @somedudeyouveneverheardof still not sure what u want but this script changes the spammer message if you type ingame

                .ssssd text (message you want)
                
                /// api_version=2
                var script = registerScript({
                    name: "ss",
                    version: "1.0",
                    authors: ["No Author ok"]
                });
                
                var Spammer = moduleManager.getModule("Spammer");
                
                script.registerModule({
                    name: "ssssd",
                    description: "Nutting in cats is illegal",
                    category: "Fun",
                    tag: "s",
                    settings: {
                        text: Setting.text({
                            name: "text",
                            default: ""
                        }),
                    }
                
                }, function (module) {
                    module.on("enable", function () {
                
                    });
                    module.on("disable", function () {
                
                    });
                    module.on("update", function () {
                    	moduleManager.getModule("Spammer").getValue("Message").set(module.settings.text.get())
                    });
                });
                
                kaduvertK Offline
                kaduvertK Offline
                kaduvert
                wrote on last edited by
                #13

                @faaatpotato Spammer was just an example module to demonstrate where it would work, now make a module with a script and try to do the same

                FaaatPotatoF 1 Reply Last reply
                0
                • kaduvertK kaduvert

                  @faaatpotato Spammer was just an example module to demonstrate where it would work, now make a module with a script and try to do the same

                  FaaatPotatoF Offline
                  FaaatPotatoF Offline
                  FaaatPotato
                  wrote on last edited by
                  #14

                  @somedudeyouveneverheardof i just gave you an example you don't need to change that much do it yourself

                  kaduvertK 1 Reply Last reply
                  0
                  • FaaatPotatoF FaaatPotato

                    @somedudeyouveneverheardof i just gave you an example you don't need to change that much do it yourself

                    kaduvertK Offline
                    kaduvertK Offline
                    kaduvert
                    wrote on last edited by kaduvert
                    #15

                    @faaatpotato it wasn't meant as a challange or something but as a way to get you to understand my problem, it doesn't work if you would replace spammer with a module created with the ScriptAPI and that's my problem, nor can you change these values via ingame chat.
                    I want to know how to fix this.

                    FaaatPotatoF 1 Reply Last reply
                    0
                    • kaduvertK kaduvert

                      @faaatpotato it wasn't meant as a challange or something but as a way to get you to understand my problem, it doesn't work if you would replace spammer with a module created with the ScriptAPI and that's my problem, nor can you change these values via ingame chat.
                      I want to know how to fix this.

                      FaaatPotatoF Offline
                      FaaatPotatoF Offline
                      FaaatPotato
                      wrote on last edited by
                      #16

                      @somedudeyouveneverheardof

                      ok sorry, this should work then

                      commandManager.executeCommands(".scriptapimodule setting "+module.settings.text.get())
                      
                      kaduvertK 1 Reply Last reply
                      0
                      • FaaatPotatoF FaaatPotato

                        @somedudeyouveneverheardof

                        ok sorry, this should work then

                        commandManager.executeCommands(".scriptapimodule setting "+module.settings.text.get())
                        
                        kaduvertK Offline
                        kaduvertK Offline
                        kaduvert
                        wrote on last edited by
                        #17

                        @faaatpotato gives me the same error as if i would type it in the chat manually.

                        ".scriptapimodule setting 123"
                        gives
                        "[LiquidBounce] Syntax: .scriptapimodule <setting>"
                        but doesn't change anything

                        FaaatPotatoF 1 Reply Last reply
                        0
                        • kaduvertK kaduvert

                          @faaatpotato gives me the same error as if i would type it in the chat manually.

                          ".scriptapimodule setting 123"
                          gives
                          "[LiquidBounce] Syntax: .scriptapimodule <setting>"
                          but doesn't change anything

                          FaaatPotatoF Offline
                          FaaatPotatoF Offline
                          FaaatPotato
                          wrote on last edited by FaaatPotato
                          #18

                          @somedudeyouveneverheardof
                          2dc3af29-7bf4-40bd-b552-fa2915a11da8-image.png
                          works for me

                          /// api_version=2
                          var script = registerScript({
                              name: "ss",
                              version: "1.0",
                              authors: ["No Author ok"]
                          });
                          
                          script.registerModule({
                              name: "ssssd",
                              description: "Nutting in cats is illegal",
                              category: "Fun",
                              tag: "s",
                              settings: {
                                  text: Setting.text({
                                      name: "text",
                                      default: ""
                                  }),
                              }
                          
                          }, function (module) {
                              module.on("enable", function () {
                              	commandManager.executeCommands(".JartexL LMode "+module.settings.text.get());
                              });
                              module.on("disable", function () {
                          
                              });
                              module.on("update", function () {
                              });
                          });
                          

                          example with a script I made

                          kaduvertK 1 Reply Last reply
                          0
                          • FaaatPotatoF FaaatPotato

                            @somedudeyouveneverheardof
                            2dc3af29-7bf4-40bd-b552-fa2915a11da8-image.png
                            works for me

                            /// api_version=2
                            var script = registerScript({
                                name: "ss",
                                version: "1.0",
                                authors: ["No Author ok"]
                            });
                            
                            script.registerModule({
                                name: "ssssd",
                                description: "Nutting in cats is illegal",
                                category: "Fun",
                                tag: "s",
                                settings: {
                                    text: Setting.text({
                                        name: "text",
                                        default: ""
                                    }),
                                }
                            
                            }, function (module) {
                                module.on("enable", function () {
                                	commandManager.executeCommands(".JartexL LMode "+module.settings.text.get());
                                });
                                module.on("disable", function () {
                            
                                });
                                module.on("update", function () {
                                });
                            });
                            

                            example with a script I made

                            kaduvertK Offline
                            kaduvertK Offline
                            kaduvert
                            wrote on last edited by
                            #19

                            @FaaatPotato
                            yeah, your example works on b73, previously played with b72. sorry about that
                            seems to be fixed in b73, sorry to bother you all

                            1 Reply Last reply
                            1
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            About
                            • Terms of Service
                            • Privacy Policy
                            • Status
                            • Contact Us
                            Downloads
                            • Releases
                            • Source code
                            • License
                            Docs
                            • Tutorials
                            • CustomHUD
                            • AutoSettings
                            • ScriptAPI
                            Community
                            • Forum
                            • Guilded
                            • YouTube
                            • Twitter
                            • D.Tube
                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups