-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsuitup.rb
29 lines (28 loc) · 967 Bytes
/
suitup.rb
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
require 'sqlite3'
require 'json'
db_file = 'C:\Program Files (x86)\Thunder Network\Thunder\Profiles\TaskDb.dat'
puts db_file
db = SQLite3::Database.new db_file
tasks = {}
db.execute( "select _rowid_, UserData from AccelerateTaskMap153066190_superspeed_1_1" ) do |row|
j = JSON.parse row[1]
p j["Result"]
j["Result"] = 0
tasks[row[0]] = j
end
p '*'*10
tasks.each do |id, value|
p id
p value
#db.execute("update AccelerateTaskMap153066190_superspeed_1_1 set UserData = :data where _rowid_ = :rowid", {"data"=>value, "rowid"=>id})
ps = db.prepare("update AccelerateTaskMap153066190_superspeed_1_1 set UserData = :data where _rowid_ = :rowid")
ps.execute('data'=>value.to_json, 'rowid'=>id)
#db.execute("select _rowid_ from AccelerateTaskMap153066190_superspeed_1_1 where _rowid_ = ?", i) do |dd|
#p dd
#end
end
p '='*10
db.execute( "select _rowid_, UserData from AccelerateTaskMap153066190_superspeed_1_1" ) do |row|
j = JSON.parse row[1]
p j["Result"]
end