Advertisement
kolpastebin

Tabs.ash

Jun 4th, 2017
1,517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. //Tabs.ash
  2. //Outputs the current tab configuration of the KGBriefcase.
  3. void main()
  4. {
  5. buffer page_text = visit_url("place.php?whichplace=kgb");
  6. string configuration = "";
  7. for i from 1 to 6
  8. {
  9. string [int][int] matches = page_text.group_string("<div id=kgb_tab" + i + "[^>]*>(.*?)</div>");
  10. string line = matches[0][1];
  11. if (line.contains_text("A Short Tab"))
  12. configuration += "1";
  13. else if (line.contains_text("A Long Tab"))
  14. configuration += "2";
  15. else
  16. configuration += "0";
  17. }
  18. string [int][int] matches2 = page_text.group_string("<div id=kgb_lightrings[^>]*><img src=\"([^\"]*)\" width=250 height=100 border=0 alt=\"([^\"]*)");
  19.  
  20. if (matches2.count() > 0)
  21. {
  22. string image_2 = matches2[0][1].group_string("kgb/(.*)")[0][1];
  23. if (image_2 != "side.gif")
  24. configuration += " - " + image_2 + " - " + matches2[0][2];
  25. }
  26. print("KGB tabs: " + configuration);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement