Astron 0 Posted April 16, 2015 What's wrong with this script please help - script SearchSystem -1,{mes "[ Find Monster ]";mes "Select";next;set .@select,select("- Monster","- Item");if (.@select == 1) { set .@id,callfunc("Mobidsearch"); if (.@id == 1) { mes "[ Find Monster ]"; mes "^FF0000Monster Not Found!^000000"; close; }} else if (.@select == 2) { set .@id,callfunc("Itemsearch"); if (.@id == 1) { mes "[ Find Monster ]"; mes "^FF0000Item Not Found!^000000"; close; } set .@id,callfunc("Mobitemsearch",.@id); if (.@id == 1) { mes "[ Find Monster ]"; mes "^FF0000Item not found! ID: "+.@id+"^000000"; close; }}set .@id,callfunc("Mobmapsearch",.@id);if (.@id == 1) { mes "[ Find Monster ]"; mes "^FF0000Monster not found in map!^000000"; close;}end;OnInit: waitingroom "Find Monster",0; end;}function script Mobidsearch {mes "[ Find Monster ]";mes "Please enter ID or Monster Name";next;input .@mobsearch$;if (mobidsearch(.@mobsearch$) == "null") return 1;set .@menu$,"";for(set .@i,0; .@i < getarraysize(@mobidsearch_id); set .@i,.@i+1) set .@menu$,.@menu$+(@mobidsearch_id[.@i]?"- "+getmonsterinfo(@mobidsearch_id[.@i],0)+" ("+@mobidsearch_id[.@i]+") Lv."+getmonsterinfo(@mobidsearch_id[.@i],1)+":":":");set .@mobid,select(.@menu$) - 1;next;set .@mobid,@mobidsearch_id[.@mobid];deletearray @mobidsearch_id[0],255;return .@mobid;}function script Itemsearch {mes "[ Find Monster ]";mes "Please enter ID or Item Name";next;input .@itemsearch$;if (itemsearchid(.@itemsearch$) == "null") return 1;set .@menu$,"";for(set .@i,0; .@i < getarraysize(@itemsearch_id); set .@i,.@i+1) set .@menu$,.@menu$+(@itemsearch_id[.@i]?"- "+getitemname(@itemsearch_id[.@i])+""+(getiteminfo(@itemsearch_id[.@i],2) == 4 || getiteminfo(@itemsearch_id[.@i],2) == 5?"["+getitemslots(@itemsearch_id[.@i])+"]":"")+" ("+@itemsearch_id[.@i]+"):":":");set .@id,select(.@menu$) - 1;set .@id,@itemsearch_id[.@id];deletearray @itemsearch_id[0],255;return .@id;}function script Mobitemsearch {set .@id,getarg(0);if (getitemname(.@id) == "null") return 1;if (mobitemsearch[.@id]) return 1;set .@menu$,"";if (@mobitemsearch_id[0] < 1) { mes "[ Find Monster ]^FF0000"; if (getiteminfo(.@id,2) == 4 || getiteminfo(.@id,2) == 5) mes ""+getitemname(.@id)+" ["+getitemslots(.@id)+"]"; else mes ""+getitemname(.@id)+""; mes "No drop from monster!^000000"; close;}for(set .@i,0; .@i < getarraysize(@mobitemsearch_id); set .@i,.@i+1) set .@menu$,.@menu$+"- "+getmonsterinfo(@mobitemsearch_id[.@i],0)+" ("+@mobitemsearch_id[.@i]+") ["+@mobitemsearch_per$[.@i]+"]:";next;set .@id,select(.@menu$) - 1;set .@id,@mobitemsearch_id[.@id];deletearray @mobitemsearch_id[0],255;deletearray @mobitemsearch_per$[0],255;return .@id;}function script Mobmapsearch {set .@id,getarg(0);if (getmonsterinfo(.@id,0) == "null")return 1;if (mobmapsearch[.@id])return 1;if (@mobmapsearch$[0] == "")return 1;mes "[ Find Monster ]";mes "Monster : "+getmonsterinfo(.@id,0)+" ["+.@id+"]";mes "Level : "+getmonsterinfo(.@id,1)+"";mes "HP : "+getmonsterinfo(.@id,2)+"";mes "EXP : "+getmonsterinfo(.@id,3)+"";mes "Job EXP : "+getmonsterinfo(.@id,4)+"";mes "Attack : "+getmonsterinfo(.@id,5)+"-"+getmonsterinfo(.@id,6)+"";mes "Def : "+getmonsterinfo(.@id,7)+"";mes "Mdef : "+getmonsterinfo(.@id,8)+"";mes "^FF0000No size available^000000";set .@menu$,"";for(set .@i,0; .@i < getarraysize(@mobmapsearch$); set .@i,.@i+1) set .@menu$,.@menu$+"- "+@mobmapsearch$[.@i]+" ["+@mobmapsearchcount[.@i]+"]:";next;set .@id,select(.@menu$) - 1;set .@mobwarp$,@mobmapsearch$[.@id];deletearray @mobmapsearch$[0],255;deletearray @mobmapsearchcount[0],255;dispbottom "Go to: "+.@mobwarp$+"";warp .@mobwarp$,0,0;return 0;} prontera,150,182,4 duplicate(SearchSystem) [ Find Monster]#1 756 Quote Share this post Link to post Share on other sites
0 Alayne 99 Posted April 17, 2015 - script SearchSystem -1,{ mes "[ Find Monster ]"; mes "Select"; next; set .@select,select("- Monster","- Item"); if (.@select == 1) { set .@id,callfunc("Mobidsearch"); if (.@id == 1) { mes "[ Find Monster ]"; mes "^FF0000Monster Not Found!^000000"; close; } } else if (.@select == 2) { set .@id,callfunc("Itemsearch"); if (.@id == 1) { mes "[ Find Monster ]"; mes "^FF0000Item Not Found!^000000"; close; } set .@id,callfunc("Mobitemsearch",.@id); if (.@id == 1) { mes "[ Find Monster ]"; mes "^FF0000Item not found! ID: "+.@id+"^000000"; close; } } set .@id,callfunc("Mobmapsearch",.@id); if (.@id == 1) { mes "[ Find Monster ]"; mes "^FF0000Monster not found in map!^000000"; close; } end;OnInit: waitingroom "Find Monster",0; end;}function script Mobidsearch { mes "[ Find Monster ]"; mes "Please enter ID or Monster Name"; next; input .@mobsearch$; if (callfunc("Mobidsearch",.@mobsearch$) == "null") return 1; set .@menu$,""; for(set .@i,0; .@i < getarraysize(@mobidsearch_id); set .@i,.@i+1) set .@menu$,.@menu$+(@mobidsearch_id[.@i]?"- "+getmonsterinfo(@mobidsearch_id[.@i],0)+" ("+@mobidsearch_id[.@i]+") Lv."+getmonsterinfo(@mobidsearch_id[.@i],1)+":":":"); set .@mobid,select(.@menu$) - 1; next; set .@mobid,@mobidsearch_id[.@mobid]; deletearray @mobidsearch_id[0],255; return .@mobid;}function script Itemsearch { mes "[ Find Monster ]"; mes "Please enter ID or Item Name"; next; input .@itemsearch$; if (callfunc("Itemsearch",.@itemsearch$) == "null") return 1; set .@menu$,""; for(set .@i,0; .@i < getarraysize(@itemsearch_id); set .@i,.@i+1) set .@menu$,.@menu$+(@itemsearch_id[.@i]?"- "+getitemname(@itemsearch_id[.@i])+""+(getiteminfo(@itemsearch_id[.@i],2) == 4 || getiteminfo(@itemsearch_id[.@i],2) == 5?"["+getitemslots(@itemsearch_id[.@i])+"]":"")+" ("+@itemsearch_id[.@i]+"):":":"); set .@id,select(.@menu$) - 1; set .@id,@itemsearch_id[.@id]; deletearray @itemsearch_id[0],255; return .@id;}function script Mobitemsearch { set .@id,getarg(0); if (getitemname(.@id) == "null") return 1; if (mobitemsearch[.@id]) return 1; set .@menu$,""; if (@mobitemsearch_id[0] < 1) { mes "[ Find Monster ]^FF0000"; if (getiteminfo(.@id,2) == 4 || getiteminfo(.@id,2) == 5) mes ""+getitemname(.@id)+" ["+getitemslots(.@id)+"]"; else mes ""+getitemname(.@id)+""; mes "No drop from monster!^000000"; close; } for(set .@i,0; .@i < getarraysize(@mobitemsearch_id); set .@i,.@i+1) set .@menu$,.@menu$+"- "+getmonsterinfo(@mobitemsearch_id[.@i],0)+" ("+@mobitemsearch_id[.@i]+") ["+@mobitemsearch_per$[.@i]+"]:"; next; set .@id,select(.@menu$) - 1; set .@id,@mobitemsearch_id[.@id]; deletearray @mobitemsearch_id[0],255; deletearray @mobitemsearch_per$[0],255; return .@id;}function script Mobmapsearch { set .@id,getarg(0); if (getmonsterinfo(.@id,0) == "null") return 1; if (mobmapsearch[.@id]) return 1; if (@mobmapsearch$[0] == "") return 1; mes "[ Find Monster ]"; mes "Monster : "+getmonsterinfo(.@id,0)+" ["+.@id+"]"; mes "Level : "+getmonsterinfo(.@id,1)+""; mes "HP : "+getmonsterinfo(.@id,2)+""; mes "EXP : "+getmonsterinfo(.@id,3)+""; mes "Job EXP : "+getmonsterinfo(.@id,4)+""; mes "Attack : "+getmonsterinfo(.@id,5)+"-"+getmonsterinfo(.@id,6)+""; mes "Def : "+getmonsterinfo(.@id,7)+""; mes "Mdef : "+getmonsterinfo(.@id,8)+""; mes "^FF0000No size available^000000"; set .@menu$,""; for(set .@i,0; .@i < getarraysize(@mobmapsearch$); set .@i,.@i+1) set .@menu$,.@menu$+"- "+@mobmapsearch$[.@i]+" ["+@mobmapsearchcount[.@i]+"]:"; next; set .@id,select(.@menu$) - 1; set .@mobwarp$,@mobmapsearch$[.@id]; deletearray @mobmapsearch$[0],255; deletearray @mobmapsearchcount[0],255; dispbottom "Go to: "+.@mobwarp$+""; warp .@mobwarp$,0,0; return 0;} prontera,150,182,4 duplicate(SearchSystem) [Find Monster]#1 756 Here's a correct version. There was several problems: 1- You didn't use tab between declarations words, but spaces. 2- You didn't call the function properly. Instead of if (mobidsearch(.@mobsearch$) == "null") use if (callfunc("Mobidsearch",.@mobsearch$) == "null") 3- More an advice than anything else, work on your indentation. It makes the script way more easy to understand and to correct. Quote Share this post Link to post Share on other sites
0 evilpuncker 503 Posted April 17, 2015 please be more specific, which part of it doesn't work, any error in console? Quote Share this post Link to post Share on other sites
0 RodRich 6 Posted April 17, 2015 @@Astron You should post a SS from you map-log, or type here what is its error!! Quote Share this post Link to post Share on other sites
What's wrong with this script please help
Share this post
Link to post
Share on other sites