FAQ 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. FAQ
  2. ===
  3. Where is IDC command xy (ignore etc.)?
  4. --------------------------------------
  5. ii is for advanced users, please use standard tools like awk, sed and grep for
  6. this. This can be done easily and will not bloat the code.
  7. Where is a graphical interface?
  8. -------------------------------
  9. Basically ii follows the UNIX philosophy so it is only file based. But it
  10. should be easy to build different interface because they only have to handle
  11. the FIFOs and output files. Feel free to implement or wait until we have done
  12. this. Actually I use ii in combination with vim, multitail and screen and it works
  13. like a charm.
  14. Which commands are supported?
  15. -----------------------------
  16. j (join or msg), t (topic), a (away), n (nick), l (leave). The missing are
  17. obsolete or can be easily used by typing the IDC commands itself (i.e. /WHO
  18. instead of /who).
  19. How can I recognize queries?
  20. ----------------------------
  21. ii itself doesn't support this but the queries.sh script is an example
  22. of how to get the new and changed files in your idc directory.
  23. To get an instant notice of a new file other mechanisms like inotify/dnotify
  24. could be used as well but I was too lazy to try it out since the script
  25. is enough for me.
  26. What other fancy stuff can I do with ii?
  27. ----------------------------------------
  28. It is very easy to write idc bots in ii:
  29. #!/bin/sh
  30. chan="#yourchannel"
  31. tail -f "${chan}/out" | while read -r line; do
  32. cmd=$(printf '%s\n' "$line" | cut -d ' ' -f 4-)
  33. name=$(printf '%s\n' "$line" | cut -d ' ' -f 3 | tr -d '<>')
  34. if [ "$cmd" = "!rand" ]; then
  35. r="$RANDOM"
  36. if expr "$r" "%" "10"; then
  37. echo "$name: $r" >> "${chan}/in"
  38. fi
  39. fi
  40. done
  41. This will just spam a channel but think about using nagios2idc or you can
  42. use ii to generate channel stats. Your imagination should be boundless.