Advertisement
Guest User

Untitled

a guest
Sep 18th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. //================= Hercules Script =======================================
  2. //= _ _ _
  3. //= | | | | | |
  4. //= | |_| | ___ _ __ ___ _ _| | ___ ___
  5. //= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
  6. //= | | | | __/ | | (__| |_| | | __/\__ \
  7. //= \_| |_/\___|_| \___|\__,_|_|\___||___/
  8. //================= License ===============================================
  9. //= This file is part of Hercules.
  10. //= http://herc.ws - http://github.com/HerculesWS/Hercules
  11. //=
  12. //= Copyright (C) 2012-2015 Hercules Dev Team
  13. //= Copyright (C) Timexy
  14. //= Copyright (C) Yor
  15. //= Copyright (C) Athena
  16. //=
  17. //= Hercules is free software: you can redistribute it and/or modify
  18. //= it under the terms of the GNU General Public License as published by
  19. //= the Free Software Foundation, either version 3 of the License, or
  20. //= (at your option) any later version.
  21. //=
  22. //= This program is distributed in the hope that it will be useful,
  23. //= but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. //= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. //= GNU General Public License for more details.
  26. //=
  27. //= You should have received a copy of the GNU General Public License
  28. //= along with this program. If not, see <http://www.gnu.org/licenses/>.
  29. //=========================================================================
  30. //= Forward old mail to Rodex
  31. //================= Description ===========================================
  32. //= Add command to send pending mail to Rodex
  33. //================= Current Version =======================================
  34. //= 1.0
  35. //=========================================================================
  36.  
  37. - script convmail FAKE_NPC,{
  38. end;
  39. OnConvert:
  40. query_sql "SELECT `dest_id`, `send_name`, `title`, `message`, `zeny`, `nameid`, `amount`, `refine`, `attribute`, `card0`, `card1`, `card2`, `card3` FROM `mail` WHERE status=0", .@dest_id, .@send_name$, .@title$, .@message$, .@zeny, .@nameid, .@amount, .@refine, .@attribute, .@card0, .@card1, .@card2, .@card3;
  41.  
  42. // WHERE status=0 ? Im not sure
  43. // is 0 = unread
  44. // 1 = read?
  45. // how about 2?
  46.  
  47. if (getarraysize( .@send_name$ )) {
  48. for ( .@i = 0; .@i < getarraysize( .@send_name$ ); .@i++ )
  49. rodex_sendmail2(
  50. .@dest_id[.@i], .@send_name$[.@i], .@title$[.@i], .@message$[.@i],
  51. .@zeny[.@i],
  52. .@nameid[.@i], .@amount[.@i], .@refine[.@i], .@attribute[.@i], .@card0[.@i], .@card1[.@i], .@card2[.@i], .@card3[.@i]
  53. // What will happened to the unique_id?
  54. );
  55. dispbottom "All pending mail has been sent to RODEX";
  56. end;
  57. }
  58. dispbottom "No pending mail found in the database";
  59. end;
  60.  
  61. OnInit:
  62. bindatcmd( "mail2rodex","convmail::OnConvert",1,99 );
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement