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.5k 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.
  • kaduvertK Offline
    kaduvertK Offline
    kaduvert
    wrote on last edited by kaduvert
    #1

    If the title is a bit confusing, look at this example:

    In the LiquidBounce native Spammer module the message setting can be changed like this via chat:
    ".spammer message asdasd"

    But if i create a module via script and want to do the same thing with a string setting:
    ".scriptmodule message asdasd"
    I get a syntax usage in the chat instead of changing the value.

    Can this issue be fixed by me or is it caused by LiquidBounce?

    example script:

    /// api_version=2
    
    var script = registerScript({
    	name: 'example',
    	version: '1',
    	authors: ['example']
    })
    
    script.registerModule({
    	name: 'Example',
    	category: 'Misc',
    	description: 'example',
        settings: {
            text: Setting.text({
                name: "text",
                default: 'sssss'
            }),
            int: Setting.integer({
                name: "int",
                default: 1000,
                min: 50,
          	    max: 5000
            })
        }
    }, function() {})
    
    The_Shadow_EmpT 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
      • kaduvertK kaduvert

        If the title is a bit confusing, look at this example:

        In the LiquidBounce native Spammer module the message setting can be changed like this via chat:
        ".spammer message asdasd"

        But if i create a module via script and want to do the same thing with a string setting:
        ".scriptmodule message asdasd"
        I get a syntax usage in the chat instead of changing the value.

        Can this issue be fixed by me or is it caused by LiquidBounce?

        example script:

        /// api_version=2
        
        var script = registerScript({
        	name: 'example',
        	version: '1',
        	authors: ['example']
        })
        
        script.registerModule({
        	name: 'Example',
        	category: 'Misc',
        	description: 'example',
            settings: {
                text: Setting.text({
                    name: "text",
                    default: 'sssss'
                }),
                int: Setting.integer({
                    name: "int",
                    default: 1000,
                    min: 50,
              	    max: 5000
                })
            }
        }, function() {})
        
        The_Shadow_EmpT Offline
        The_Shadow_EmpT Offline
        The_Shadow_Emp
        wrote on last edited by
        #2

        @somedudeyouveneverheardof https://liquidbounce.net/docs/ScriptAPI/

        kaduvertK 1 Reply Last reply
        0
        • The_Shadow_EmpT The_Shadow_Emp

          @somedudeyouveneverheardof https://liquidbounce.net/docs/ScriptAPI/

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

          @the_shadow_emp can you more clearly describe what i did wrong?
          or can you do it right with the help of your enlightning ressource

          ? 1 Reply Last reply
          0
          • kaduvertK kaduvert

            @the_shadow_emp can you more clearly describe what i did wrong?
            or can you do it right with the help of your enlightning ressource

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

            @somedudeyouveneverheardof https://liquidbounce.net/docs/ScriptAPI/Global Instances

            kaduvertK 1 Reply Last reply
            0
            • ? A Former User

              @somedudeyouveneverheardof https://liquidbounce.net/docs/ScriptAPI/Global Instances

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

              @mems can you give more details? i don't really get what that page should tell me
              do i need to register the module to the commandManager?
              and if how to do that?

              commandManager.registerCommand(moduleManager.getModule('Example'))
              

              that is what i tried but it doesn't seem to work

              The_Shadow_EmpT 1 Reply Last reply
              0
              • kaduvertK kaduvert

                @mems can you give more details? i don't really get what that page should tell me
                do i need to register the module to the commandManager?
                and if how to do that?

                commandManager.registerCommand(moduleManager.getModule('Example'))
                

                that is what i tried but it doesn't seem to work

                The_Shadow_EmpT Offline
                The_Shadow_EmpT Offline
                The_Shadow_Emp
                wrote on last edited by
                #6

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

                kaduvertK FaaatPotatoF 2 Replies Last reply
                1
                • 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