PDA

View Full Version : Lich 4.5.0



Tillmen
07-28-2014, 03:03 PM
I need people to test a new version of Lich. I took out almost all of the changes I wanted to do, so this update shouldn't affect scripts at all. It will require Ruby 2.0. I briefly tested it on Windows 8, 7, Vista, and XP, but the problems never seem to show up on my test machines anyway. All the Windows API calls use new code compatible with Ruby 2.0. I also added sqlite access to scripts, though nothing should be using it at this point. If this tests out ok and everyone (or almost everyone) switches over, I'll start updating scripts to use sqlite so settings don't disappear anymore.

To use sqlite in your script, the simple way is to do something like:



Setting['kill all humans'] = true

if Setting['kill all humans']
cast 525
end


This should look pretty familiar, but it's totally different, and stuff. There's no S on the end of Setting!

The old Settings were loaded into memory when the script started, and saved when the script closed. So, Settings could be used like a variable in memory, because that's what they were.

The new Setting is read or written to the disk every time Setting[] shows up in your script. So, if you're going to read the same Setting more than once and aren't expecting it to change in between, you should put it into a variable first so it's only read from the disk once.

If you want to actually use sql statements, you can use Script.db.



db = Script.db
db.query("CREATE TABLE IF NOT EXISTS jerks (name TEXT NOT NULL, reason TEXT NOT NULL);")
db.execute("SELECT name,reason FROM jerks;") do |row|
echo "#{row[0]} is a jerk because #{row[1]}"
end


Script.db allows untrusted scripts to create or open lich/data/<scriptname>.db3. Trusted scripts can create their own database where ever they want with
db = SQLite3::Database.new(filename)

For the installing and whatnot:

Back up your Lich folder. This update shouldn't trash anything, but you should have a backup anyway.

Uninstall Ruby 1.8.

Download 32bit Ruby 2.0 from http://rubyinstaller.org.

If you're using Vista or later: don't run it from the browser. Save it, open your file manager, find it, right click and run as administrator.

In the installer, check the checkbox next to "Associate .rb and .rbw files with this Ruby installation"

Download lich-4.5.6.rbw from http://lichproject.org/download/lich-4.5.6.rbw, put it in your Lich folder, rename it to lich.rbw (rename or move the lich.rbw that's already there)

Double-clickify lich.rbw

A message box should pop up saying you don't have sqlite3, click yes to install it.

wait...

A message box should pop up saying Lich will restart, click ok.

A message box should pop up saying you don't have gtk2, click yes to install it.

wait...

A message box should pop up saying Lich will restart, click ok.

???

profit!

If you try it, let me know if it works or not, and any problems you have.

Whirlin
07-28-2014, 03:11 PM
This should look pretty familiar, but it's totally different, and stuff. There's no S on the end of Setting!


No S????

Mind

Blown


... I'll give this a shot on 8.1 when I get home and report any problems.

Buckwheet
07-28-2014, 03:38 PM
Everyone should move to 2.0 just so I can start posting my issues with 2.0!

Khariz
07-28-2014, 05:00 PM
I'm getting to this part with 1.9.3:


A message box should pop up saying you don't have sqlite3, click yes to install it.

I click yes, and wait an unlimited amount of time, and I'm never getting the reset popup. Windows 8 (not 8.1). Lich/Ruby appears to be doing nothing process wise on my computer. I restart lick and get the above message again. Repeat.

Edit: Just FYI for analysis purposes, I'm so massively unlocked that anything should be allowed to run in the background. There's no A/V installed, I'm in unsigned driver mode (using some kernal mode drivers when I do some naughty things), but everything about the boot is standard windows besides that. There's no reason I'd be blocking anything.

Edit2: Watching in the task manager, the second I click yes in the dialog box, ruby ends task.

Khariz
07-28-2014, 05:23 PM
Okay, so interestingly, I can't even get the old Lich to work at all if I install Lich 1.8.7-p734 or 1.9.3-p545, but if I got back and install 1.8.7-p352 everything goes back to running fine. I'm certain that I'm installing as admin too. Not sure why only the ancient version works on my computer.

Tillmen
07-28-2014, 05:27 PM
I click yes, and wait an unlimited amount of time, and I'm never getting the reset popup. Windows 8 (not 8.1). Lich/Ruby appears to be doing nothing process wise on my computer. I restart lick and get the above message again. Repeat.


Should be fixed in http://lichproject.org/download/lich-4.5.1.rbw

Tillmen
07-28-2014, 05:30 PM
Okay, so interestingly, I can't even get the old Lich to work at all if I install Lich 1.8.7-p734 or 1.9.3-p545, but if I got back and install 1.8.7-p352 everything goes back to running fine. I'm certain that I'm installing as admin too. Not sure why only the ancient version works on my computer.

That's just because Ruby usually doesn't come with Gtk.

Khariz
07-28-2014, 05:33 PM
Should be fixed in http://lichproject.org/download/lich-4.5.1.rbw

Worked great. Downloading the gtk2 part now.

Khariz
07-28-2014, 05:37 PM
Okay...now it's in another endless loop. I got to the gtk2 part. it downloaded about 10 .gem files (that I could see, may have been more like 20 because some flashed by fast before the restart dialog box).

But when Lich restarts, it keeps re-prompting me to install gtk2 again. But on the subsequent attempts, it is no longer re-downloading the .gem files. It knows it has already done that, but the gtk2 dialog box keeps popping back up again after the restart.

Tillmen
07-28-2014, 05:40 PM
It's starting to look like the gtk2 gem isn't going to work on Ruby 1.9 anymore.. Apparently cairo recently dropped support for Ruby 1.9. I don't know.. maybe we don't need Ruby 1.9 anyway?

Khariz
07-28-2014, 05:41 PM
So I should try it in Ruby 2?

Khariz
07-28-2014, 05:47 PM
Okay, installed Ruby 2.0.0-p481. Both packages installed properly. Lich 4.5.1 successfully loaded. I'm in game. All ;favs scripts loaded. COnnect to LNET. Everything is working great.

SpiffyJr
07-28-2014, 05:50 PM
Where's the new cool stuff anyway?

Also, screw Ruby 1.9. Download ruby installer for windows, gem install gtk2, and profit.

Tillmen
07-28-2014, 05:55 PM
Where's the new cool stuff anyway?

Also, screw Ruby 1.9. Download ruby installer for windows, gem install gtk2, and profit.

No new cool stuff for you!

If I put in the new cool stuff now, no one would use it because they wouldn't want to redo their settings and scripts and whatnot.

Tillmen
07-28-2014, 05:58 PM
Alright.. so I was going to have it install an older gtk2 gem if you were using Ruby 1.9, but I got tired of trying to find one the worked. Apparently it stopped working several version ago. It'll probably be better for sharing scripts if everyone is using Ruby 2.0 anyway.

Khariz
07-28-2014, 06:14 PM
Alright.. so I was going to have it install an older gtk2 gem if you were using Ruby 1.9, but I got tried of trying to find one the worked. Apparently it stopped working several version ago. It'll probably be better for sharing scripts if everyone is using Ruby 2.0 anyway.

The only wonky thing that is happening so far, but it's not a big enough deal to figure out what's causing it, is that the Stormfront GUI elements for the left hand, right hand, and prepped spell are blacked out. But as soon as you do something to cause data to populate the field, it fixes itself.

Edit, so if you stow and unsheath your weapon, you'll then not see a black box any more. If you prep a spell, that box won't be black any more.

Edit2: Another bug - when go2 starts, Stormfront will often not scroll the screen along with the text. I'll have to manually page down back to current. That's a new one.

Buckwheet
07-28-2014, 06:22 PM
The only wonky thing that is happening so far, but it's not a big enough deal to figure out what's causing it, is that the Stormfront GUI elements for the left hand, right hand, and prepped spell are blacked out. But as soon as you do something to cause data to populate the field, it fixes itself.

Edit, so if you stow and unsheath your weapon, you'll then not see a black box any more. If you prep a spell, that box won't be black any more.

Edit2: Another bug - when go2 starts, Stormfront will often not scroll the screen along with the text. I'll have to manually page down back to current. That's a new one.

The blank hands issue is one that I am also having on 2.0. uberbarwiz is broken, and crosscharcom behaves weirdly. When you start crosscharcom as a slave you never have to specify "localhost" and now you do. Not a major issue just something new.

Everyone should do 2.0 because there are some potential data collection scripts/utilities in the works that would allow for interesting and new functions being stored in online databases. This is made easier in 2.0 I am told.

Khariz
07-28-2014, 06:30 PM
;activespells is a bit wonky under 2.0. About 20% of the time I have logged in so far, it'll be black in the box. But if I log out and back in, it works.

Tillmen
07-28-2014, 07:19 PM
The black box issues may be fixed in http://lichproject.org/download/lich-4.5.3.rbw

It's hard to tell, because it didn't happen every time. Also let me know if this update adds any lag.

Tillmen
08-22-2014, 01:20 AM
Just uploaded http://lichproject.org/download/lich-4.5.6.rbw which should probably fix any issues with it failing to install sqlite3 or launch the game. Apparently under some setups ShellExecuteEx fails with an "access denied" error, even if it's already elevated and regardless of what it tries to execute. ShellExecute seems to work though, so now it falls back to that if the first one fails.

Also, apparently the gtk2 gem isn't precompiled on 64bit Ruby, so get the 32bit version to avoid some hassle.

Aiska
08-22-2014, 06:56 AM
Thanks for the update, Tillmen. Encountering the following:

1. --- error: SpellRanks.load: marshal data too short
2. Time remaining for triple learning: 2:58:00. (I'm not on gift.)
3. --- Exception: undefined method `to_a' for "Armor Reinforcement":String uberspells:115:in `block (3 levels) in start_script'
4. Still unable to use any lnet commands, despite receiving the welcome message (no error, just no response). Scripts now work with lnet active, but are considerably laggy.

Thanks for your hard work. I wouldn't play GS without this thing.

edit 08/23: LNet's working for me again :)