Bad route fix, npcitem table query

This commit is contained in:
Brandon Cornejo committed 2019-01-25 19:46:14 -06:00
1 parent 724a354e7d
commit 89790fe231
4 files changed
+72 -22

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@
#math {xpgain} {$GMCP[vitals][xp] - $GMCP[oldvitals][xp]};
#if {$xpgain > 5000} {
#format {xp_gain_display} {<179>(+%g XP)<099>} {$xpgain};
#format {xp_gain_display} {(+<169>%g<099>xp)} {$xpgain};
#echo {$xp_gain_display};
}
+66 -11
View File
@@ -65,7 +65,10 @@
#ALIAS {db gatherable %1} {
#unvariable {gatherable_display};
#format {query} {SELECT item_name, room_short, shop_items.room_id, map_id, INSTR(item_name, '%s') pos FROM shop_items INNER JOIN rooms on rooms.room_id = shop_items.room_id WHERE pos > 0 AND sale_price = 'gather';} {%1};
#variable {search_term} {%1};
#replace {search_term} {'} {''};
#format {query} {SELECT item_name, room_short, shop_items.room_id, map_id, INSTR(item_name, '%s') pos FROM shop_items INNER JOIN rooms on rooms.room_id = shop_items.room_id WHERE pos > 0 AND sale_price = 'gather' LIMIT 10;} {$search_term};
#format {db_command} {sqlite3 -separator ";" src/quow.db "%s"} {$query};
#script {gatherable_query_result} {$db_command};
@@ -74,7 +77,7 @@
#list {last_query_list} {clear};
#if {$gatherable_result_size > 0} {
#format {gatherable_display} {%cResults for gatherables matching %c"%c%s%c"%c:} {bold blue}{green}{yellow}{%1}{green}{bold blue};
#format {gatherable_display} {%cResults for gatherables matching "%c%s%c":} {bold blue}{yellow}{%1}{bold blue};
#echo {$gatherable_display};
#var {gather_count} {0};
@@ -105,7 +108,10 @@
#ALIAS {db npc %1} {
#unvariable {npc_display};
#format {query} {SELECT npc_name, rooms.map_id, rooms.room_id, rooms.room_short, INSTR(npc_name, '%s') pos FROM npc_info INNER JOIN rooms on rooms.room_id = npc_info.room_id WHERE pos > 0 LIMIT 10} {%1};
#variable {search_term} {%1};
#replace {search_term} {'} {''};
#format {query} {SELECT npc_name, rooms.map_id, rooms.room_id, rooms.room_short, INSTR(npc_name, '%s') pos FROM npc_info INNER JOIN rooms on rooms.room_id = npc_info.room_id WHERE pos > 0 LIMIT 10} {$search_term};
#format {db_command} {sqlite3 -separator ";" src/quow.db "%s"} {$query};
#script {npc_query_result} {$db_command};
@@ -114,7 +120,7 @@
#list {last_query_list} {clear};
#if {$npc_result_size > 0} {
#format {npc_display} {%cResults for NPCs matching %c"%c%s%c"%c:} {bold blue}{green}{yellow}{%1}{green}{bold blue};
#format {npc_display} {%cResults for NPCs matching "%c%s%c":} {bold blue}{yellow}{%1}{bold blue};
#echo {$npc_display};
#var {npc_count} {0};
@@ -130,8 +136,7 @@
{room_short}{$npc_results[4]}
};
#format {npc_display} {%c [%c%d%c]: %c%s%c found in %c%s%c,%c %s%c} {bold blue}{cyan}{$npc_count}{bold blue}
{green}{$npc_info[npc_name]}{bold blue}{orange}{$npc_info[room_short]}{bold blue}{orange}{$npc_info[map_name]}{bold blue};
#format {npc_display} {%c [%c%d%c]: %c%s%c found in %c%s%c,%c %s%c} {bold blue}{cyan}{$npc_count}{bold blue}{green}{$npc_info[npc_name]}{bold blue}{orange}{$npc_info[room_short]}{bold blue}{orange}{$npc_info[map_name]}{bold blue};
#echo {$npc_display};
#variable {last_query_list[$npc_count]} {$npc_info};
@@ -143,10 +148,57 @@
}
};
#ALIAS {db npcitem %1} {
#unvariable {npcitem_display};
#variable {search_term} {%1};
#replace {search_term} {'} {''};
#format {query} {SELECT npc_info.map_id, npc_name, npc_info.room_id, item_name, room_short, INSTR(item_name, '%s') pos FROM 'npc_info' INNER JOIN npc_items ON npc_items.npc_id = npc_info.npc_id INNER JOIN rooms on npc_info.room_id = rooms.room_id WHERE pos > 0 LIMIT 10} {$search_term};
#format {db_command} {sqlite3 -separator ";" src/quow.db "%s"} {$query};
#script {npcitem_query_result} {$db_command};
#list {npcitem_query_result} {size} {npcitem_result_size};
#list {last_query_list} {clear};
#if {$npcitem_result_size > 0} {
#format {npcitem_display} {%cResults for NPC items matching "%c%s%c":} {bold blue}{yellow}{%1}{bold blue};
#echo {$npcitem_display};
#var {npcitem_count} {0};
#foreach {$npcitem_query_result[%*]} {inner_query_result} {
#replace {inner_query_result} {\\} {};
#list npcitem_results create {${inner_query_result}};
#variable {npcitem_info} {
{map_name}{$map_id_names[$npcitem_results[1]]}
{npc_name}{$npcitem_results[2]}
{room_id}{$npcitem_results[3]}
{item_name}{$npcitem_results[4]}
{room_short}{$npcitem_results[5]}
};
#format {npcitem_display} {%c [%c%d%c]: %c%s%c found on %c%s%c in %c%s%c,%c %s%c} {bold blue}{cyan}{$npcitem_count}{bold blue}{green}{$npcitem_info[item_name]}{bold blue}{white}{$npcitem_info[npc_name]}{bold blue}{orange}{$npcitem_info[room_short]}{bold blue}{orange}{$npcitem_info[map_name]}{bold blue};
#echo {$npcitem_display};
#variable {last_query_list[$npcitem_count]} {$npcitem_info};
#math {npcitem_count} {$npcitem_count + 1};
}
} {
#format {npcitem_display} {%cQuery Result: %c%s%c was not found.} {bold blue}{green}{%1}{bold blue};
#echo {$npcitem_display};
}
};
#ALIAS {db item %1} {
#unvariable {item_display};
#format {query} {SELECT item_name, sale_price, room_short, shop_items.room_id, map_id, INSTR(item_name, '%s') pos FROM shop_items INNER JOIN rooms on rooms.room_id = shop_items.room_id WHERE pos > 0 AND sale_price != 'gather' LIMIT 10;} {%1};
#variable {search_term} {%1};
#replace {search_term} {'} {''};
#format {query} {SELECT item_name, sale_price, room_short, shop_items.room_id, map_id, INSTR(item_name, '%s') pos FROM shop_items INNER JOIN rooms on rooms.room_id = shop_items.room_id WHERE pos > 0 AND sale_price != 'gather' LIMIT 10;} {$search_term};
#format {db_command} {sqlite3 -separator ";" src/quow.db "%s"} {$query};
#script {item_query_result} {$db_command};
@@ -155,7 +207,7 @@
#list {last_query_list} {clear};
#if {$item_result_size > 0} {
#format {item_display} {%cResults for items matching %c"%c%s%c"%c:} {bold blue}{green}{yellow}{%1}{green}{bold blue};
#format {item_display} {%cResults for items items matching "%c%s%c":} {bold blue}{yellow}{%1}{bold blue};
#echo {$item_display};
#var {item_count} {0};
@@ -187,7 +239,10 @@
#ALIAS {db room %1} {
#unvariable {room_display};
#format {query} {SELECT room_id, map_id, room_short, room_type, INSTR(room_short, '%s') pos FROM rooms WHERE pos > 0 LIMIT 10;} {%1};
#variable {search_term} {%1};
#replace {search_term} {'} {''};
#format {query} {SELECT room_id, map_id, room_short, room_type, INSTR(room_short, '%s') pos FROM rooms WHERE pos > 0 LIMIT 10;} {$search_term};
#format {db_command} {sqlite3 -separator ";" src/quow.db "%s"} {$query};
#script {room_query_result} {$db_command};
@@ -196,7 +251,7 @@
#list {last_query_list} {clear};
#if {$room_result_size > 0} {
#format {room_display} {%cResults for rooms matching %c"%c%s%c"%c:} {bold blue}{green}{yellow}{%1}{green}{bold blue};
#format {room_display} {%cResults for items items matching "%c%s%c":} {bold blue}{yellow}{%1}{bold blue};
#echo {$room_display};
#var {room_count} {0};
@@ -237,7 +292,7 @@
#format {route_command} {python src/maproute.py %s %s} {$route_current_room_id} {$route_target_room_id};
#script {speedwalk_result} {$route_command};
#if {$speedwalk_result[1] = 0} {
#if {"$speedwalk_result[1]" == "0"} {
#format {route_error} {%c[speedwalk] Unable to find route to %c%s%c or unknown current room.} {bold blue}{green}{$target_room[room_short]}{bold blue};
#echo {$route_error};
#return;
-2
View File
@@ -181,8 +181,6 @@
#line {log} {$xptimer_file} {$spotstring};
}
#line {log} {$xptimer_file} {};
#line {log} {$xptimer_file} {};
#line {log} {$xptimer_file} {\n\r\n\r.:: Visit Timers ::. };
#foreach {$visittimers[]} {spot} {