Forum

> > CS2D > Scripts > Menu disappear when not wanted to.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Menu disappear when not wanted to.

13 replies
To the start Previous 1 Next To the start

old Menu disappear when not wanted to.

Mami Tomoe
User Off Offline

Quote
Couldn't think of a better title
Script:
http://unrealsoftware.de/files_show.php?file=14359

This is a door script thing that has password when you click E on a specific door, I like it but its easy to crack since when you hit the wrong number the menu disappears.

If the menu will disappear you know that is not the password and can start cracking the password easily.

Code >


I want the menu to stay even if you clicked the wrong number and only check if you were right after you finished all the password steps.

I was about to ask @user Avo: (the creator) but his last visit was 4 weeks ago...

old Re: Menu disappear when not wanted to.

Nekomata
User Off Offline

Quote
A variable is basically a box stored in your computer's memory. You can name that box and assign a value to it. For example, I'll make a box called 'myName' and assign my name to it.
1
myName = "Nighthawk"
Now, 'myName' is a variable. Whenever I call 'myName', like this:
1
print(myName)

I'll get this as a result/output:
1
Nighthawk

I can even change the value of the variable:
1
myName = "I need milk"
So now, the result would be:
1
I need milk

You can assign a name/value to any variable. Variables always starts from a letter.
It can be this:
1
lolwut1234 = "asdf"
But It can never be this:
1
1234lolwut = "asdf"


user Starkkz has a pretty nice tutorial for LUA here. He explained it way better than me, so have a look at that.

old Re: Menu disappear when not wanted to.

Nekomata
User Off Offline

Quote
I am not exactly familiar with the script and I've edited a single line on a whim. Try this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addhook("menu", "pkl.HookMenu")
pkl.HookMenu = function(id,title,b)
     if title:sub(1, 12) == "Lock - step " then
          if b == "x" or b == 0 then return end
          local step = tonumber(title:sub(13))
          local ch = pkl.Chars[b]
          pkl.Comb[id][2] = pkl.Comb[id][2]..ch
          if #pkl.Comb[id][1] == #pkl.Comb[id][2] then
               parse("triggerposition "..pkl.Comb[id][3][1].." "..pkl.Comb[id][3][2])     
          else
               if pkl.Comb[id][2] == pkl.Comb[id][1]:sub(1, #pkl.Comb[id][2]) then
                    parse("sv_sound2 "..id.."\"wpn_select.wav\"")
                    pkl.OpenMenu(id, step + 1)
               else
                    parse("sv_sound2 "..id.."\"wpn_denyselect.wav\"")
		   	 pkl.OpenMenu(id) --This should make it work
               end
          end
     end
end

Complete thing >

old Re: Menu disappear when not wanted to.

Mami Tomoe
User Off Offline

Quote
@user Nekomata: It works but even if you click the wrong password it will open the door, I need it to check the password only on the last key.

Edit: >>>A LINK<<<
P.S. Ignore my name in the video, it was meant to give this name to a Bot but I used new game so it changed my name instead.
edited 1×, last 28.09.15 04:08:08 am

old Re: Menu disappear when not wanted to.

tontonEd
User Off Offline

Quote
line 55 - the object is tringgered if the both filed have the same lenght, whereas it should be tringgered if both field have the same password.

I won't post code since that would certainly doesn't work without tests in game. gl

+
line 28 : tile(x,y, "entity") return int
if int and X => X

line 51 : b == "x" return false
if false or X => X
edited 1×, last 28.09.15 10:31:15 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview