yojimbos_law

some horrible skill checking script

Dec 9th, 2017
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. print_html("Don't you dare run this script without first saving this text file in your data folder as \"items that give skills.txt\": https://pastebin.com/Lp2vfajK");
  2. if(get_property("biggest_item_checked") == "" ){
  3. set_property("biggest_item_checked",9001);
  4. }
  5. wait(69420);
  6. string[string] items_that_give_skills;
  7. file_to_map("items that give skills.txt",items_that_give_skills);
  8. foreach i in $items[]{
  9. if(get_property("biggest_item_checked").to_int() < i.to_int() + 1 && i.usable && !i.combat && i.spleen == 0 && i.quality == "" && !i.multi ){
  10. string blarg = visit_url("desc_item.php?whichitem="+i.descid);
  11. string this_item;
  12. string gives_this_skill;
  13. if(blarg.contains_text("Grants Skill:")){
  14. blarg = blarg.substring(blarg.index_of("whichskill=") + 11);
  15. blarg = blarg.substring(0,blarg.index_of("&"));
  16. this_item = i.name;
  17. gives_this_skill = blarg.to_int().to_skill().to_string();
  18. items_that_give_skills[this_item] = gives_this_skill;
  19. }
  20. set_property("biggest_item_checked",i.to_int());
  21. }
  22. }
  23. map_to_file(items_that_give_skills,"items that give skills.txt");
  24.  
  25. foreach j,k in items_that_give_skills{
  26. if(!have_skill(k.to_skill()) && available_amount(j.to_item()) == 0){
  27. print("Need "+j+" to get "+k);
  28. }
  29. }
  30. foreach j,k in items_that_give_skills{
  31. if(!have_skill(k.to_skill()) && available_amount(j.to_item()) > 0){
  32. print("Already have "+j+" for getting "+k);
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment