jokekid

adventure plugins pseudo-code

Jun 2nd, 2015
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. adventure plugins:
  2.  
  3. expand autobroadcast:
  4. autobc when player LEAVES region
  5. autobc when player kills boss
  6. variable plugin:
  7. variable types: int, boolean
  8. commands:
  9. setvar [name] [type] [value]:
  10. if [name] exists:
  11. if [type] != [name].[type]:
  12. chat.log: variable exists as different type, aborting operation.
  13. return;
  14. else:
  15. switch([type]):
  16. case "int":
  17. case "bool":
  18. case "boolean":
  19. jsonFile.variables[name] = [value] //variables es un diccionario
  20. break;
  21. case default:
  22. chat.log: [type] is not a recognized variable type, please use "int" or "bool".
  23. break;
  24. opvar [name] [operation] [value]:
  25. if [name] !exists:
  26. chat.log: variable [name] doesn't exist.
  27. return;
  28. else:
  29. switch([operation]):
  30. case "sum":
  31. try{
  32. jsonFile.variables.[name] += [value]
  33. }catch(){}
  34. break;
  35. case "multiply":
  36. try{
  37. jsonFile.variables.[name] *= [value]
  38. }catch(){}
  39. break;
  40. case "divide":
  41. try{
  42. jsonFile.variables.[name]=(int) (jsonFile.variables.[name]/[value])
  43. }catch(){}
  44. break;
Advertisement
Add Comment
Please, Sign In to add comment