Jump to content


  • Content Count

  • Donations

  • Joined

  • Last visited

  • Days Won


Everything posted by CmP

  1. CmP

    Seekbar help

    According to the documentation for prompt function, "default" parameter of the function can be used to set default value for any prompt type. Example code for seek bar that "remembers" previous values: local input local defaultValue = 50 while true do if gg.isVisible() then gg.setVisible(false) input = gg.prompt({'Test seek bar [10; 100]'}, {defaultValue}, {'number'}) if input ~= nil then defaultValue = input[1] end end gg.sleep(100) end
  2. CmP

    gg.toast does not show.

    Does it work properly in previous versions? For example, 73.11.
  3. CmP

    Need help pls

    There is no reason in creating checkboxes that will be displayed in prompt window, if the user is not supposed to change their state. If you need to perform one action when checkbox is checked for the first time and another action otherwise, you can use a variable that will indicate, whether the checkbox was checked at least once. Example: local option1Checked = false -- Will be executed once when the checkbox is checked for the first time local function option1Setup() gg.toast('Option 1 was checked for the first time') end -- Will be executed when the checkbox is checked for the second, third, fourth, etc time local function option1Loop() gg.toast('Option 1 was checked') end local function menu() local choice = gg.prompt({'Option 1'}, {false}, {'checkbox'}) if choice ~= nil then if choice[1] then if not option1Checked then option1Setup() option1Checked = true else option1Loop() end end end end while true do if gg.isVisible() then gg.setVisible(false) menu() end gg.sleep(100) end checkbox_example.lua
  4. CmP

    How to freeze value?

    "setValues" function is not intended to freeze values, use "addListItems" function for this.
  5. CmP

    damage hack

    Why would you upload log of the calls to GG API functions without extracting useful code from it? Currently uploaded file is extremely redundant. Around 7500 lines containing "gg.getFile()" and only around 20 lines of actual code. Actual code from the file: But even this code contains some redundancy, i.e. the calls to "gg.getFile" and "debug.traceback" functions.
  6. CmP

    help me please lua

    If you need to repeat the code for a known amount of times, use numerical "for" loop. Example: -- repeat 25 times for i = 1, 25 do -- the code to repeat here end References: https://www.lua.org/manual/5.3/manual.html#3.3.5 http://lua-users.org/wiki/ForTutorial
  7. An example from the topic in "Guides" section: Examples of Lua scripts (#d2j0lrom) If you need other examples, use forum search. Similar questions have been asked multiple times, so it should not be hard to find suitable answer/example.
  8. There is an example in this topic: How To Add This function (#896daqaw) Also refer to the documentation about "alert" function: https://gameguardian.net/help/classgg.html#a07201e70d15be5ac19da2eb3d1c0e352
  9. Storing password(s) as plain text at pastebin is generally bad idea. Such protection is nearly useless. Slightly better approach may be storing hashes of the correct passwords there, computing hash of the input string and comparing it with correct ones. One way to fix your current code is to interpret "content" field of the table returned by "makeRequest" function as string with code that returns a table containing correct passwords. This correction may be applied to your code in 2 steps. First step is to change the contents of your paste. For example, if you have such string: key = {'123', '456'} transform it to: return {'123', '456'} Second step is to fix the code to treat web-page contents accordingly. For example, this code where second line has no meaning: local passwords = gg.makeRequest(pastebin).content) pcall(pw) can be transformed to: local contents = gg.makeRequest(pastebin).content local passwords = load(contents)() If there are no errors, variable "passwords" will contain the table with the correct passwords and the remaining code will work as intended.
  10. A review of the example above for anyone who wonders why it works and why one should not code like this. Second line contains the following code: DESTROYER = gg.makeRequest("link").content There are 3 main steps in this code: 1. "makeRequest" function from "gg" table is called with the corresponding argument. 2. Result returned by the function is indexed with the key "content". 3. Value from the step 2 is saved in "DESTROYER" variable. Then, on the third line there is the following code: if not DESTROYER then which checks the condition and executes the code after "then" keyword, if the condition is true. Otherwise, it executes the code after "else" keyword. To understand, why "one should not code like this", let's review the documentation for "makeRequest" function at GG help. https://gameguardian.net/help/classgg.html#ad020d50d3af0a36733e0cbc231055c55 In this case we are interested in the description of the value returned by the function: Now, let's get back to the second line of the example. When function succeeds, the code from the second line behaves as intended. Table returned by the function is indexed with the key "content" and the result of this operation is stored in the variable. And what happens, when there is an error? String returned by the function is indexed with the key "content" and the value is stored in the variable. By default, there is no meaning of indexing string with a key and luckily for the example, the value returned by such operation is nil. But this behavior is not obvious and not obvious behavior may often lead to errors. Then how can the example be modified to avoid non-obvious behavior? The result of the call to "makeRequest" function should be saved to a variable. Then the type of the variable should be checked. If it is "table", the function has succeeded, the variable can be indexed with the key "content" and the result of this operation can be stored in another variable. And if it is "string", then an error occurred, the contents of the variable can be printed to log (via "print" function) and/or shown to the user (via "alert" function). Example to illustrate the answer above: local functionResult = gg.makeRequest('link') local content if type(functionResult) == 'table' then content = functionResult.content elseif type(functionResult) == 'string' then -- print/alert error description end -- other actions Such modification to the code explicitly shows which actions will be performed and when (function succeeds / function fails) getting rid from non-obvious behavior.
  11. Once again, there is a contradiction between your statement and the reality: You keep repeating that there is "execution error" in @TopGEOYT's script "when cancelling" and that your's example does not have it, but without the correction of what you have called "syntax" your example is meaningless and TopGEOYT's is not. We don't know, have you known about the mistake in your example or not before I have corrected it. Therefore, simple conclusion can be made: your example is worse than TopGEOYT's.
  12. If "a long time ago the error was corrected", then the example that is posted less than 1-2 hours ago would not contain it, but it does. It is posted multiple times and all of the posts contain the mistake I have described. Such references to "the logic" do not show that you are familiar with it or that you understand it's base principles at all.
  13. Don't mind him. Someone who can't admit the mistake he made, who really thinks that he is "closing everyone's mouths" when there are no replies on his absurd statements, who is sure that he "won" every discussion he participated into is not worth the attention of adequate forum members. Such behavior is typical for either kids with some kind of childish outburst or trolls.
  14. It will work and also it will check for the value being equal to nil or false. I am not sure, if this check has a meaning (i.e. if "content" field of the table returned by "makeRequest" function can be nil), but even if it doesn't, the example (with the correction) will still work, just that line with the call to "alert" function will never be executed.
  15. Actually, his example is fine. There is no checks for possible errors, but it works normally as shown in the video. And this example is wrong. It won't work at all. You store "content" field of the table returned by "makeRequest" function in the variable "DESTROYER", but then you check the value of non-existing variable "Content". Non-existing variables in Lua contain special value called "nil", which is evaluated to "false" when used in conditional expressions. Therefore, "not Content" will be always equal to "true". Your example will always show the alert and never execute the line with the call to "load" function. To fix this mistake, as you have already figured out (I hope), the line if not Content then needs to be replaced with if not DESTROYER then
  16. Example scripts for your task are present everywhere. To change the value you need to use "setValues" function. Therefore, your next action may be checking the documentation (and the examples of usage) for this function in GG help. If it will be not enough, then you can search function name in the forum, you will find even more examples. Still not enough? No problem. Check open-source scripts. Considering that tasks similar to yours are quite common, it should not be hard to find suitable example. The only question is have you even tried to do it.
  17. Review to a script: Response from script's author: (Read the image or description) Roblox Jailbreak script (#492ojibz)
  18. CmP


    Using similar approach as in Script compiler, it's possible to redefine potentially harmful functions for them to display an alert containing info about passed arguments and options either to allow function execution or not. It can be even extended to simulate successful call to a function, so that if script checks returned result, it will "think" that harmful action has been done successfully. This will allow to examine all potentially harmful actions script tries to perform, because it will not crash/exit after first try of opening/removing a file.
  19. CmP


    To ask user to select a file you can use prompt function with "file" type. Example: local t = gg.prompt({'Select a file'}, nil, {'file'}) To delete a file you can use remove function from standard operating system library provided by Lua. Example: print(os.remove('/storage/emulated/0/Downloads/test.txt'))
  20. CmP

    GG Chatroom

    Apply same check to the password as you did with username. tmp=Menu[1] for i=1,WhiteListWord:len() do check=WhiteListWord:sub(i) check="["..check.."]" tmp=tmp:gsub(check,"") end if tmp~="" then Warnings=Warnings.."\nX Bad Username.\nOnly letters, numbers and underline can be accepted." end User can (intentionally or not) input some characters that will break the list of parameters of the request.
  21. Open the spoiler to see error screenshot.
  22. Looks like you have troubles with it. Have read first sentence of the post and ignored everything else. You would better explain why have not you tested your changes to the original tool before creating the topic instead of defending those useless "encryption" tools you have been regularly posting here. It's really funny when you write "fixed" at the top of the web-page, but it does not work at all.
  23. Everyone knows this "encryption" is absolutely useless when user is able to run the script. Moreover, your "NEW ONLINE XOR COMPILER" does not even work properly. It fails with the following error: And the cause of it is your lack of knowledge about how to write multi-line string literals in Lua.
  24. Instead of using numerical for loop to traverse a table, you may want to use the generic for loop. This way suits better when all elements from a table need to be processed. Also you won't need to care about size of the table. Example of freezing values using generic for and "ipairs" iterator function: local x = gg.getResults(100) for i, v in ipairs(x) do v.value = '1' v.freeze = true end gg.addListItems(x) Another thing is that for you would better use "setValues" function, unless you really need to add items to saved list.
  25. But, if I am not mistaken, something like this is already possible by modifying lib that is loaded in process memory. This way is likely more limited than modifying the file itself, but it may work.
  • Create New...