• Anmelden

soraiuga

Rekrut

  • »soraiuga« ist der Autor dieses Themas

Motto: Darf ich Ihre Bestellung aufnehmen? xD

  • Nachricht senden

1

Samstag, 10. Oktober 2009, 21:13

Problem mit Passworteingabeskript von Caeser

(So, selbst "verschoben" :rolleyes: )

Hi Leute,
ich habe ein kleines Problem mit folgendem Skript von Caeser:

Spoiler

Ruby Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#///////////////////////////////////Passworteingabe/////////////////////////////
#~~~~~~~~~~~~~~~~~~by Caesar~~~~~~~~~~~~~~~~
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#_______________________________________________
 
module Password
  def Password.store!(var_id, header="Passwort eingeben")
$game_temp.password_header = header
$game_temp.password_calling = true
$game_temp.password_var_id = var_id
  end
end
#=========
class Scene_Password
  def main
@spriteset = Spriteset_Map.new
@window_password = Window_Password.new
#::::::::
Graphics.transition
loop do
  Graphics.update
  Input.update
  update
  if $scene != self
    break
  end
end
#::::::::
@window_password.dispose
@spriteset.dispose
  end
  #----------
  def update
@window_password.update
if Input.getkey(13)
  $game_variables[$game_temp.password_var_id] = $game_temp.password
  $scene = Scene_Map.new 
end
  end
end
#==========
class Window_Password < Window_Base
  def initialize
super(200, 100, 240, $game_temp.password_header == "" ? 64 : 92)
self.back_opacity = 180
self.contents = Bitmap.new(width-32, height-32)
$game_temp.password = ""
@text = ""
refresh
  end
  #------
  def refresh
self.contents.clear
self.contents.font.name = $defaultfonttype != nil ? $defaultfonttype : $fontface
#self.contents.font.size = $defaultfontsize != nil ? $defaultfontsize : $fontsize
self.contents.font.color = system_color
self.contents.draw_text(0, 0, width-32, 32, $game_temp.password_header, 1)
#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
# Schriftart im Eingabefeld
self.contents.font.name = "Arial"
self.contents.font.size = 22
self.contents.font.color = normal_color
#.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
y = $game_temp.password_header == "" ? 0 : 32
self.contents.draw_rect(0, y+1, width-32, 27, Color.new(0, 0, 0))
self.contents.draw_rect(1, y+2, width-34, 25, Color.new(128, 128, 128, 128))
self.contents.fill_rect(2, y+3, width-36, 23, Color.new(50, 50, 50, 152))
self.contents.draw_text(3, y+3, width-38, 23, $game_temp.password)
caret_x = self.contents.text_size($game_temp.password).width+3
self.contents.fill_rect(caret_x, y+4, 2, 21, normal_color)
  end
  #-----
  def update
super
$game_temp.password[-1] = "" if  Input.getkey(8) and $game_temp.password.size != 0 
$game_temp.password << " " if Input.getkey(32)
if Input.getstate(16)
  $game_temp.password << "A" if Input.getkey(65)
  $game_temp.password <<  "B" if Input.getkey(66)
  $game_temp.password << "C" if Input.getkey(67)
  $game_temp.password << "D" if Input.getkey(68)
  $game_temp.password << "E" if Input.getkey(69) 
  $game_temp.password << "F" if Input.getkey(70)
  $game_temp.password << "G" if Input.getkey(71)
  $game_temp.password << "H" if Input.getkey(72)
  $game_temp.password << "I" if Input.getkey(73)
  $game_temp.password << "J" if Input.getkey(74)
  $game_temp.password << "K" if Input.getkey(75)
  $game_temp.password << "L" if Input.getkey(76)
  $game_temp.password << "M" if Input.getkey(77)
  $game_temp.password << "N" if Input.getkey(78)
  $game_temp.password << "O" if Input.getkey(79)
  $game_temp.password << "P" if Input.getkey(80)
  $game_temp.password << "Q" if Input.getkey(81)
  $game_temp.password << "R" if Input.getkey(82)
  $game_temp.password << "S" if Input.getkey(83)
  $game_temp.password << "T" if Input.getkey(84)
  $game_temp.password << "U" if Input.getkey(85)
  $game_temp.password << "V" if Input.getkey(86)
  $game_temp.password << "W" if Input.getkey(87)
  $game_temp.password << "X" if Input.getkey(88)
  $game_temp.password << "Y" if Input.getkey(89)
  $game_temp.password << "Z" if Input.getkey(90)
  $game_temp.password << "=" if Input.getkey(48)
  $game_temp.password << "!" if Input.getkey(49)
  $game_temp.password << "\"" if Input.getkey(50)
  $game_temp.password << "§" if Input.getkey(51)
  $game_temp.password << "$" if Input.getkey(52)
  $game_temp.password << "%" if Input.getkey(53)
  $game_temp.password << "&" if Input.getkey(54)
  $game_temp.password << "/" if Input.getkey(55)
  $game_temp.password << "(" if Input.getkey(56)
  $game_temp.password <<  ")" if Input.getkey(57)
  $game_temp.password << "?" if Input.getkey(219)
  $game_temp.password << "Ü" if Input.getkey(186)
  $game_temp.password << "*" if Input.getkey(187)    
  $game_temp.password << ";" if Input.getkey(188)
  $game_temp.password << "_" if Input.getkey(189)    
  $game_temp.password << ":" if Input.getkey(190)
  $game_temp.password << "'" if Input.getkey(191)
  $game_temp.password << "Ö" if Input.getkey(192)
  $game_temp.password << "°" if Input.getkey(220)  
  $game_temp.password << "`" if Input.getkey(221)
  $game_temp.password << "Ä" if Input.getkey(222)
  $game_temp.password << ">" if Input.getkey(226)
elsif Input.getstate(17)
  $game_temp.password << "}" if Input.getkey(48)
  $game_temp.password << "²" if Input.getkey(50)
  $game_temp.password << "³" if Input.getkey(51)
  $game_temp.password << "{" if Input.getkey(55)
  $game_temp.password << "[" if Input.getkey(56)
  $game_temp.password << "]" if Input.getkey(57)
  $game_temp.password << "€" if Input.getkey(69) 
  $game_temp.password << "µ" if Input.getkey(77)
  $game_temp.password << "@" if Input.getkey(81)
  $game_temp.password << "~" if Input.getkey(187)
  $game_temp.password << "\\" if Input.getkey(219)
  $game_temp.password << "|" if Input.getkey(226)
else
  $game_temp.password << "a" if Input.getkey(65)
  $game_temp.password << "b" if Input.getkey(66)
  $game_temp.password << "c" if Input.getkey(67)
  $game_temp.password << "d" if Input.getkey(68)
  $game_temp.password << "e" if Input.getkey(69) 
  $game_temp.password << "f" if Input.getkey(70)
  $game_temp.password << "g" if Input.getkey(71)
  $game_temp.password << "h" if Input.getkey(72)
  $game_temp.password << "i" if Input.getkey(73)
  $game_temp.password << "j" if Input.getkey(74)
  $game_temp.password << "k" if Input.getkey(75)
  $game_temp.password << "l" if Input.getkey(76)
  $game_temp.password << "m" if Input.getkey(77)
  $game_temp.password << "n" if Input.getkey(78)
  $game_temp.password << "o" if Input.getkey(79)
  $game_temp.password << "p" if Input.getkey(80)
  $game_temp.password << "q" if Input.getkey(81)
  $game_temp.password << "r" if Input.getkey(82)
  $game_temp.password << "s" if Input.getkey(83)
  $game_temp.password << "t" if Input.getkey(84)
  $game_temp.password << "u" if Input.getkey(85)
  $game_temp.password << "v" if Input.getkey(86)
  $game_temp.password << "w" if Input.getkey(87)
  $game_temp.password << "x" if Input.getkey(88)
  $game_temp.password << "y" if Input.getkey(89)
  $game_temp.password << "z" if Input.getkey(90)
  $game_temp.password << "0" if Input.getkey(48)
  $game_temp.password << "1" if Input.getkey(49)
  $game_temp.password << "2" if Input.getkey(50)
  $game_temp.password << "3" if Input.getkey(51)
  $game_temp.password << "4" if Input.getkey(52)
  $game_temp.password << "5" if Input.getkey(53)
  $game_temp.password << "6" if Input.getkey(54)
  $game_temp.password << "7" if Input.getkey(55)
  $game_temp.password << "8" if Input.getkey(56)
  $game_temp.password <<  "9" if Input.getkey(57)
  $game_temp.password << "<" if Input.getkey(62)
  $game_temp.password << "ü" if Input.getkey(186)
  $game_temp.password << "+" if Input.getkey(187)    
  $game_temp.password << "," if Input.getkey(188)
  $game_temp.password << "-" if Input.getkey(189)    
  $game_temp.password << "." if Input.getkey(190)
  $game_temp.password << "#" if Input.getkey(191)
  $game_temp.password << "ö" if Input.getkey(192)
  $game_temp.password << "ß" if Input.getkey(219)
  $game_temp.password << "^" if Input.getkey(220)
  $game_temp.password << "´" if Input.getkey(221) 
  $game_temp.password << "ä" if Input.getkey(222)
  $game_temp.password << "<" if Input.getkey(226)
end
$game_temp.password << "0" if Input.getkey(96)
$game_temp.password << "1" if Input.getkey(97)
$game_temp.password << "2" if Input.getkey(98)
$game_temp.password << "3" if Input.getkey(99)
$game_temp.password << "4" if Input.getkey(100)
$game_temp.password << "5" if Input.getkey(101)
$game_temp.password << "6" if Input.getkey(102)
$game_temp.password << "7" if Input.getkey(103)
$game_temp.password << "8" if Input.getkey(104)
$game_temp.password << "9" if Input.getkey(105)
$game_temp.password << "*" if Input.getkey(106)  
$game_temp.password << "+" if Input.getkey(107)
$game_temp.password << "-" if Input.getkey(109)
$game_temp.password << "/" if Input.getkey(111)
until self.contents.text_size($game_temp.password).width < 202
  $game_temp.password[-1] = ""
end
if ! (@text == $game_temp.password)
  @text = $game_temp.password.clone
  refresh
end
  end
end
#==========
class Scene_Map
  def call_password
$game_temp.password_calling = false
$game_player.straighten
$scene = Scene_Password.new
  end
end
#==========
class Game_Temp
  attr_accessor :password
  attr_accessor :password_calling
  attr_accessor :password_var_id
  attr_accessor :password_header
  alias init initialize
  def initialize
init
@password = ""
@password_calling = false
@password_var_id = 0
@password_header = ""
  end
end
#==========
class Bitmap
  def draw_rect(x, y, width, height, color)
fill_rect(x, y, width, 1, color)
fill_rect(x+width-1, y, 1, height, color)
fill_rect(x, y+height-1, width, 1, color)
fill_rect(x, y, 1, height, color)
  end
end
#===========
module Input
  @GetAsyncKeyState = Win32API.new 'user32', 'GetAsyncKeyState', 'l', 'l' 
  @keybd_event = Win32API.new 'user32', 'keybd_event', %w(l l l l), '' 
  #---------------
  def self.getkey(key)
return false if @GetAsyncKeyState.call(key) == 0
setkey_up(key) 
return true
  end
  #----------------
  def self.getstate(key)
return ! Win32API.new("user32","GetKeyState",['i'],'i').call(key).between?(0, 1)
  end
  #----------------
  def self.setkey_up(key) 
@keybd_event.call(key,0,2,0) 
  end 
end 
zum Lesen den Text mit der Maus markieren


Ich weiß leider nicht mehr, wie man das einbaut. Desshalb wollte ich fragen, ob irgendjemand dieses Skript selber kennt und weiß, wie man es verwendet. ?_?
Ich meine, dass ich das Skript sogar in diesem Forum (leider in der alten Version) gefunden habe. Ich habe dieses Skript (und Anleitung zum Einbauen ^^) jedenfalls nicht mehr hier finden können.

Kann mir vielleicht jemand helfen?
Danke schon einmal für alle Antworten ^-^

Soraiuga

soraiuga

Rekrut

  • »soraiuga« ist der Autor dieses Themas

Motto: Darf ich Ihre Bestellung aufnehmen? xD

  • Nachricht senden

2

Sonntag, 11. Oktober 2009, 12:31

19 Aufrufe und keine Antwort?
Pöse :(

Wenn denn keiner weiß, wie man das Skript benutzt (schade eigentlich^^"), kennt jemand vielleicht eines, mit dem man ein Passwort eingeben kann dass in einer Variable gespeichert und abgefragt werden kann?

15h Wartezeit.. Und das von Samstag Nacht auf Sonntag Morgen.. Also Bitte. Nächstes mal die 3 Tage warten vor dem Pushen. ~Monsta

(*schäm*
:-| Tut mir leid... Hab glatt die Regel vergessen.)

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »soraiuga« (11. Oktober 2009, 16:54)


3

Sonntag, 11. Oktober 2009, 12:49

Geht auch ohne scripte...

Bild

wenn dus aber mit script lösen willst, is wahrscheinlich auch schöner

Edit:
Das ganze geht auch mit zahlen...

Bild

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Relinu« (11. Oktober 2009, 13:02)


soraiuga

Rekrut

  • »soraiuga« ist der Autor dieses Themas

Motto: Darf ich Ihre Bestellung aufnehmen? xD

  • Nachricht senden

4

Sonntag, 11. Oktober 2009, 15:25

Hee Hoo, Relinu! :D

Jepp, diese beiden Methoden sind mir bekannt.
Aber wie du bereits sagtest: Mit Skript sieht das einfach besser aus (und ist ein wenig leichter zu handhaben bei mehreren Passwörtern.)

Ist einfach schöner, so ne kleine Box zu haben, in der man das Passwort per Hand eingeben kann, als dieses Enter Hero Name-Ich-Bin-Ein-Riesen-Fenster in dem man erst jeden Buchstaben einzeln anwählen muss. ^^

5

Sonntag, 11. Oktober 2009, 16:14

kannst auch das kleine mini fenster holen un dann das script hier einfügen: Hier

soraiuga

Rekrut

  • »soraiuga« ist der Autor dieses Themas

Motto: Darf ich Ihre Bestellung aufnehmen? xD

  • Nachricht senden

6

Sonntag, 11. Oktober 2009, 16:52

Ich möchte es ja eben nicht über die Input Numbersache machen, sondern über ein kleines Extrafenster in das man den Text eingeben kann, wie wenn man einen Eintrag schreibt. ^^
(man, so schlecht drücke ich mich sonst nicht aus >_<)

Das ärgerliche ist, ich habe ein anderes Projekt in dem Das Script läuft.
Ich weiß nur, wie man Scene_Map verändern muss....

Edit(Obwohl der Post noch nicht mal abgeschickt ist): So, hab die Scripts im anderen Projekt mal auf "password" durchsucht und siehe da: Eine Zeile im Interpreter 1.

Kurz: Sora glücklich - Thema erledigt ^-^
Ready for close up x3

Anemone

Rekrut

Motto: Was zählt ist nicht das eigene Leben, sondern es aufs Spiel zusetzen.

  • Nachricht senden

7

Samstag, 17. Oktober 2009, 16:43

Neues Script über main machen und das script einfügen.

Per event oda script dann das hia aufrufen lassen:

Quellcode

1
2
Password.store! 1, 'Das Passwort ist: Geheim'
$scene=Scene_Password.new


Erklärung:

Quellcode

1
Password.store! variablen_id, text_der_angezeigt_werden_soll

variablen_id= du hast ja im spiel die möglichkeit per event variablen zu deklarieren und da gibste dann einfach die nummer (id) von der ein
text_der_angezeigt_werden_soll = spricht für sich oder?

wenn du dann das script starten willst benutzt du:

Quellcode

1
$scene=Scene_Password.new


es ist egal ob du Password.store! davor schon einmal benutzt hast oder nicht, du kannst die beiden zeilen völlig von einander unabhängig benutzen.

Um die variable dann zu checken nimmst du ein script weil du im event den variablen nur integer zuordnen kannst, du willst aber n String:

Quellcode

1
2
3
if $game_variables[variablen_id]=='Geheim'
  #Das was der machen soll hier hin
end

Geheim ist in meinen beispiel jz das Password.

ich habs in meinen test in ein parralel event gesetzt mit folgenden inhalt:
script:

Quellcode

1
2
3
4
5
6
if $game_variables[1]=='Geheim'
  p 'passwort stimmt :D'
  $game_switched[1]=true
else
  get_character(0).erase
end

dann eine 2. seite mit den switch 1 ON als voraussetzung, wo dann das getahn wird wenn das password stimmt.

Ich hoffe das hilft dir weiter,
mfg Anemone

Ähnliche Themen

Social Bookmarks