#CLASS {Buttons} {enable} #ALIAS ConnectDB {#VAR rs %comcreate( "ADODB.Recordset");#if ('%2'<>'') {#VAR Sql "SELECT * FROM items WHERE name='%2' order by sort asc"} {#VAR Sql "SELECT * FROM items WHERE type='%1' order by sort asc"};#CALL @rs.Open( @Sql, @ConnStr,2,2);#CALL @rs.MoveFirst} #ALIAS GetList {ConnectDB %1;#VAR packlist "";#WHILE (not @rs.eof) {#VAR packlist %additem( @rs("effect"):@rs("name"), @packlist);#CALL @rs.MoveNext};#CALL @rs.Close;#VAR rs ""} #ALIAS GetString {ConnectDB %1;#VAR packlist "";#WHILE (not @rs.eof) {#VAR packlist %additem( @rs("name"), @packlist);#CALL @rs.MoveNext};#CALL @rs.Close;#VAR rs ""} #VAR ConnStr {Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%char\backpack.mdb} #VAR packlist {} #VAR rs {} #VAR container {} #VAR handitem {} #VAR Sql {SELECT * FROM items WHERE name='@wand' order by sort asc} #BUTTON 1 {pills} {GetList pill;#var wand %PICK( "p:Select potion/pill to quaf/eat", "o:1", @packlist);#if (@wand) {ConnectDB wand @wand;get '@wand' @container;#var command @rs("command");@command @wand}} {} {} {} {} {} {} {} {} {} {} {} {11} {} {} {} "" {} {} {} #BUTTON 2 {wand} {GetList wand;#VAR wand %PICK( "p:Select wand/staff to use/hold", "o:1", @packlist);#IF (@wand) {ConnectDB wand @wand;get '@wand' @container;hold @wand;#IF (@rs("autouse")=1) {#VAR command @rs("command");@command;rem @wand;put '@wand' @container;hold @handitem;#VAR packlist @rs("chargesleft");#MATH packlist @packlist-1;#VAR rs("chargesleft").value @packlist;#CALL @rs.Update;#IF (@packlist=1) {#SPEAK recharge}};#CALL @rs.Close;#VAR rs ""}} {} {} {} {} {} {} {} {} {Pos} {1} {417} {11} {} {} {} "" {} {} {} #CLASS 0