viewing paste Twitter NPC | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
/////////////////////////////////////////////////////////////////////////
//#####################################################################//
//###   #####   ##      ####    ###       #####         ##          ###//
//###   ####   ##    #   ##     ###   ##   ####   ###   ##   ####   ###//
//###   ###   ##    ###   ###   ###   ###   ###   ###   ##   ####   ###//
//###   ##   ##            ##   ###   ####   ##   ###   ##   ####   ###//
//###       ##   ############   ###   #####   #   ###   ##   ####   ###//
//###       ##   ############   ###   #####   #   ###   ##   ####   ###//
//###   ##   ##   ######   ##   ###   ####   ##   ###   ##   ####   ###//
//###   ###   ##   ####   ###   ###   ###   ###   ###   ##   ####   ###//
//###   ####   ##        ####     #   ##   ####   ###   ##   ####   ###//
//###   #####   #############    ##       #####         ###############//
//#####################################################################//
//=====================================================================//
//GM Status Checker for SQL Servers Only                               //
//Made by: Keldon a.k.a. joecalis                                      //
//Forum Topic: http://www.eathena.ws/board/index.php?showtopic=275490  //
//=====================================================================//
//--Features:                                                          //
//=====================================================================//
//Can leave messages (tweets).                                         //
//Shows the date the tweet was posted.                                 //
//Displays up to 30 messages.                                          //
//Pay cash points to leave a message.                                  //
//GMs can Create table automatically on npc click.                     //
//GMs can delete all messages (messages will be deleted when the GM    //
//that deleted it logs out, sometimes it takes longer to delete).      //
//Announces the Tweet automatically after it is sent.                  //
//=====================================================================//
//--Configs:                                                           //
//=====================================================================//
//-getgmlevel()==99 //Change to what minimum GM Level you want for it  //
//to activate GM Options.                                              //
//-set @statusb$,"^XXXXXX" //The X represents the numbers and letters  //
//that makes up the color of the text, Change it to what ever you like.//
//-izlude,136,93,3 //Change to what ever map you want.                 //
//-#CASHPOINTS<10 //Change 10 to what minimum cash points needed to    //
//post you want.                                                       //
//-#CASHPOINTS-10 //Change 10 to what amount you want it to cost when  //
//posting.                                                             //
//-set @npcname$,"[^ff0000Twitter^000000]" //Change Twitter to what    //
//name of your npc you want to be                                      //
/////////////////////////////////////////////////////////////////////////
 
 
izlude,136,90,3 script  Twitter 857,{
if(getgmlvl==99){
if($twitteron==0){
query_sql "CREATE TABLE IF NOT EXIST  `twitter` (`char_id` int(11) unsigned NOT NULL ,`char_name` varchar(30) NOT NULL ,`message` varchar(100) NOT NULL ,`date` varchar(30) NOT NULL ,`week` varchar(30) NOT NULL ,`number` int(2) unsigned NOT NULL ,PRIMARY KEY (  `number` ) )";
set $twitteron,1;
}
}
set @npcname$,"[^ff0000Twitter^000000]";
mes @npcname$;
mes "Do you want to leave a ^0000fftweet^000000 for 10 Credits?";
next;
switch(select("Read Tweets:Leave Tweet:Quit")){
    case 1:
    set @twt,0;
    query_sql("select char_id,char_name,message,date,week from `twitter` ORDER BY `number`  DESC  LIMIT 30", @twtid, @twtnames$, @twtmes$,@twtdate$,@twtweek$);
    
    if(getarraysize(.twtid))
    {
        mes @npcname$;
        mes "No entries found.";
            close;
    }
    
    while(@twt<getarraysize(@twtid))
    {
        mes @npcname$;
        mes "MESSAGE by NAME on DATE";
        set @twtstart,@twt;
        while((@twt<@twtstart+10) && @twtid[@twt])
        {
            mes "^0000ff"+@twtmes$[@twt]+"^000000 by ^ff0000"+@twtnames$[@twt]+"^000000 on";
            mes "^00ff00"+@twtdate$[@twt]+"^000000";
            mes "^00ff00"+@twtweek$[@twt]+"^000000";
            mes "^0000ff============================^000000";
            set @twt,@twt+1;
        
        }
        next;
    }
 
    if(getgmlevel()==99)callfunc "twittergm";
    mes @npcname$;
    mes "You reached the end of the list.";
    close;
 
    case 2:
    if(#CASHPOINTS<10){
    mes @npcname$;
    mes "You don't have enough credits.";
    close;
    }
    mes @npcname$;
    mes "Insert Your Message,";
    mes "Tweet must be equal or lower than 100 characters.";
    input @mytweet$;
    next;
    mes @npcname$;
    mes "If your tweet is longer than 100 characters it will not be added.";
    mes "Are you sure you want to put this message?";
    mes "^00ff00"+@mytweet$+"^000000";
    next;
    switch(select("Yes:No")){
        case 1:
        set $twtnumbers,$twtnumbers+1;
        set @week,gettime(4);
        if(@week==0)set @week$,"Sunday";
        if(@week==1)set @week$,"Monday";
        if(@week==2)set @week$,"Tuesday";
        if(@week==3)set @week$,"Wednesday";
        if(@week==4)set @week$,"Thursday";
        if(@week==5)set @week$,"Friday";
        if(@week==6)set @week$,"Saturday";
        set #CASHPOINTS,#CASHPOINTS-10;
        query_sql ("INSERT INTO `twitter` (char_id,char_name,message,date,week,number) VALUES ("+getcharid(0)+",'"+strcharinfo(0)+"','"+@mytweet$+"',NOW(),'"+@week$+"',"+$twtnumbers+")");
        dispbottom "You now have a total of "+#CASHPOINTS+" Credits.";
        announce "[Tweet] "+strcharinfo(0)+" : "+@mytweet$+"",bc_all,"0x2B60DE";
        mes @npcname$;
        mes "Tweet sent.";
        close;
 
        case 2:
        close;
        }
    case 3:
    close;
}
}
 
function    script  twittergm   {
    mes @npcname$;
    mes "What would you like to do?.";
    next;
    switch(select("Delete All:Quit")){
        case 1:
        set $twtnumbers,0;
        query_sql "DROP TABLE `twitter`;";
        query_sql "CREATE TABLE `twitter` (`char_id` int(11) unsigned NOT NULL ,`char_name` varchar(30) NOT NULL ,`message` varchar(100) NOT NULL ,`date` varchar(30) NOT NULL ,`week` varchar(30) NOT NULL ,`number` int(2) unsigned NOT NULL ,PRIMARY KEY (  `number` ) )";
        mes @npcname$;
        mes "Done.";
        close;
 
        case 2:
        close;
    }
}
Viewed 772 times, submitted by Guest.